mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-08 18:06:36 +00:00
commit
d3ce4af541
2
setup.py
2
setup.py
@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
||||
|
||||
setup(
|
||||
name="home-assistant-frontend",
|
||||
version="20210804.0",
|
||||
version="20210809.0",
|
||||
description="The Home Assistant frontend",
|
||||
url="https://github.com/home-assistant/frontend",
|
||||
author="The Home Assistant Authors",
|
||||
|
@ -56,7 +56,11 @@ export class CloudRemotePref extends LitElement {
|
||||
<div class="connection-status">
|
||||
${this.hass.localize(
|
||||
`ui.panel.config.cloud.account.remote.${
|
||||
remote_connected ? "connected" : "not_connected"
|
||||
remote_connected
|
||||
? "connected"
|
||||
: remote_enabled
|
||||
? "connecting"
|
||||
: "not_connected"
|
||||
}`
|
||||
)}
|
||||
</div>
|
||||
|
@ -123,8 +123,8 @@ class HuiEnergyGridGaugeCard
|
||||
></ha-gauge>
|
||||
<div class="name">
|
||||
${returnedToGrid! >= consumedFromGrid!
|
||||
? "Returned to the grid"
|
||||
: "Consumed from the grid"}
|
||||
? "Netto returned to the grid"
|
||||
: "Netto consumed from the grid"}
|
||||
</div>`
|
||||
: "Grid neutrality could not be calculated"}
|
||||
</ha-card>
|
||||
|
@ -276,21 +276,26 @@ export class HuiEnergySolarGraphCard
|
||||
|
||||
// Process solar forecast data.
|
||||
if (forecasts && source.config_entry_solar_forecast) {
|
||||
let forecastsData: Record<string, number> | undefined;
|
||||
const forecastsData: Record<string, number> | undefined = {};
|
||||
source.config_entry_solar_forecast.forEach((configEntryId) => {
|
||||
if (!forecastsData) {
|
||||
forecastsData = forecasts![configEntryId]?.wh_hours;
|
||||
return;
|
||||
}
|
||||
if (!forecasts![configEntryId]) {
|
||||
return;
|
||||
}
|
||||
Object.entries(forecasts![configEntryId].wh_hours).forEach(
|
||||
([date, value]) => {
|
||||
if (date in forecastsData!) {
|
||||
forecastsData![date] += value;
|
||||
const dateObj = new Date(date);
|
||||
if (
|
||||
dateObj < energyData.start ||
|
||||
(energyData.end && dateObj > energyData.end)
|
||||
) {
|
||||
return;
|
||||
}
|
||||
dateObj.setMinutes(0, 0, 0);
|
||||
const time = dateObj.getTime();
|
||||
if (time in forecastsData) {
|
||||
forecastsData[time] += value;
|
||||
} else {
|
||||
forecastsData![date] = value;
|
||||
forecastsData[time] = value;
|
||||
}
|
||||
}
|
||||
);
|
||||
@ -298,16 +303,9 @@ export class HuiEnergySolarGraphCard
|
||||
|
||||
if (forecastsData) {
|
||||
const solarForecastData: ScatterDataPoint[] = [];
|
||||
for (const [date, value] of Object.entries(forecastsData)) {
|
||||
const dateObj = new Date(date);
|
||||
if (
|
||||
dateObj < energyData.start ||
|
||||
(energyData.end && dateObj > energyData.end)
|
||||
) {
|
||||
continue;
|
||||
}
|
||||
for (const [time, value] of Object.entries(forecastsData)) {
|
||||
solarForecastData.push({
|
||||
x: dateObj.getTime(),
|
||||
x: Number(time),
|
||||
y: value / 1000,
|
||||
});
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ export class HuiEnergyUsageGraphCard
|
||||
data.push({
|
||||
label:
|
||||
type === "used_solar"
|
||||
? "Solar"
|
||||
? "Consumed solar"
|
||||
: entity
|
||||
? computeStateName(entity)
|
||||
: statId,
|
||||
|
@ -1902,6 +1902,7 @@
|
||||
"title": "Remote Control",
|
||||
"connected": "Connected",
|
||||
"not_connected": "Not Connected",
|
||||
"reconnecting": "Reconnecting",
|
||||
"access_is_being_prepared": "Remote control is being prepared. We will notify you when it's ready.",
|
||||
"info": "Home Assistant Cloud provides a secure remote connection to your instance while away from home.",
|
||||
"instance_is_available": "Your instance is available at",
|
||||
|
Loading…
x
Reference in New Issue
Block a user