Added temperature (apparent) high/low, deprecated max/min (#12233)
parent
df69680d24
commit
852ce9f990
|
@ -33,6 +33,11 @@ DEFAULT_LANGUAGE = 'en'
|
|||
|
||||
DEFAULT_NAME = 'Dark Sky'
|
||||
|
||||
DEPRECATED_SENSOR_TYPES = {'apparent_temperature_max',
|
||||
'apparent_temperature_min',
|
||||
'temperature_max',
|
||||
'temperature_min'}
|
||||
|
||||
# Sensor types are defined like so:
|
||||
# Name, si unit, us unit, ca unit, uk unit, uk2 unit
|
||||
SENSOR_TYPES = {
|
||||
|
@ -90,16 +95,28 @@ SENSOR_TYPES = {
|
|||
'°C', '°F', '°C', '°C', '°C',
|
||||
'mdi:thermometer',
|
||||
['currently', 'hourly', 'daily']],
|
||||
'apparent_temperature_high': ["Daytime High Apparent Temperature",
|
||||
'°C', '°F', '°C', '°C', '°C',
|
||||
'mdi:thermometer', ['daily']],
|
||||
'apparent_temperature_min': ['Daily Low Apparent Temperature',
|
||||
'°C', '°F', '°C', '°C', '°C',
|
||||
'mdi:thermometer',
|
||||
['currently', 'hourly', 'daily']],
|
||||
'apparent_temperature_low': ['Overnight Low Apparent Temperature',
|
||||
'°C', '°F', '°C', '°C', '°C',
|
||||
'mdi:thermometer', ['daily']],
|
||||
'temperature_max': ['Daily High Temperature',
|
||||
'°C', '°F', '°C', '°C', '°C', 'mdi:thermometer',
|
||||
['currently', 'hourly', 'daily']],
|
||||
['daily']],
|
||||
'temperature_high': ['Daytime High Temperature',
|
||||
'°C', '°F', '°C', '°C', '°C', 'mdi:thermometer',
|
||||
['daily']],
|
||||
'temperature_min': ['Daily Low Temperature',
|
||||
'°C', '°F', '°C', '°C', '°C', 'mdi:thermometer',
|
||||
['currently', 'hourly', 'daily']],
|
||||
['daily']],
|
||||
'temperature_low': ['Overnight Low Temperature',
|
||||
'°C', '°F', '°C', '°C', '°C', 'mdi:thermometer',
|
||||
['daily']],
|
||||
'precip_intensity_max': ['Daily Max Precip Intensity',
|
||||
'mm/h', 'in', 'mm/h', 'mm/h', 'mm/h',
|
||||
'mdi:thermometer',
|
||||
|
@ -185,6 +202,9 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
|||
forecast = config.get(CONF_FORECAST)
|
||||
sensors = []
|
||||
for variable in config[CONF_MONITORED_CONDITIONS]:
|
||||
if variable in DEPRECATED_SENSOR_TYPES:
|
||||
_LOGGER.warning("Monitored condition %s is deprecated.",
|
||||
variable)
|
||||
sensors.append(DarkSkySensor(forecast_data, variable, name))
|
||||
if forecast is not None and 'daily' in SENSOR_TYPES[variable][7]:
|
||||
for forecast_day in forecast:
|
||||
|
@ -288,9 +308,13 @@ class DarkSkySensor(Entity):
|
|||
elif self.forecast_day > 0 or (
|
||||
self.type in ['daily_summary',
|
||||
'temperature_min',
|
||||
'temperature_low',
|
||||
'temperature_max',
|
||||
'temperature_high',
|
||||
'apparent_temperature_min',
|
||||
'apparent_temperature_low',
|
||||
'apparent_temperature_max',
|
||||
'apparent_temperature_high',
|
||||
'precip_intensity_max',
|
||||
'precip_accumulation']):
|
||||
self.forecast_data.update_daily()
|
||||
|
|
Loading…
Reference in New Issue