Skip to content

Commit

Permalink
v2.0.2
Browse files Browse the repository at this point in the history
fix error on expired sensors
  • Loading branch information
dave_albright committed May 30, 2023
1 parent afc56d2 commit 52cbf9e
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ All the conditions listed above will be updated every 5 minutes.
**_Wunderground API caveat:
The daypart object as well as the temperatureMax field OUTSIDE of the daypart object will appear as null in the API after 3:00pm Local Apparent Time.
The affected sensors will return as "Today Expired" with a value of "" when this condition is met._**
The affected sensors will return as "Today Expired" with a value of "Unknown" when this condition is met._**
Variations above marked with "#d" are daily forecasts.
Expand Down
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v2.0.2
fix error on expired sensors - HASS 2023.5 rejecting string "-", change to None (shows as "Unknown)
corrects issues # 169, 173

v2.0.1
add user-agent to config_flow (error on docker installation)

Expand Down
2 changes: 1 addition & 1 deletion custom_components/wundergroundpws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ All the conditions listed above will be updated every 5 minutes.
**_Wunderground API caveat:
The daypart object as well as the temperatureMax field OUTSIDE of the daypart object will appear as null in the API after 3:00pm Local Apparent Time.
The affected sensors will return as "Today Expired" with a value of "" when this condition is met._**
The affected sensors will return as "Today Expired" with a value of "Unknown" when this condition is met._**
Variations above marked with "#d" are daily forecasts.
Expand Down
2 changes: 1 addition & 1 deletion custom_components/wundergroundpws/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "wundergroundpws",
"name": "Wundergroundpws",
"version": "2.0.1",
"version": "2.0.2",
"documentation": "https://github.com/cytech/Home-Assistant-wundergroundpws/tree/v2.X.X",
"issue_tracker": "https://github.com/cytech/Home-Assistant-wundergroundpws/issues/",
"requirements": [],
Expand Down
10 changes: 5 additions & 5 deletions custom_components/wundergroundpws/wupws_forecast_sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@
icon="mdi:thermometer",
device_class=SensorDeviceClass.TEMPERATURE,
unit_fn=lambda metric: UnitOfTemperature.CELSIUS if metric else UnitOfTemperature.FAHRENHEIT,
value_fn=lambda data, _: cast(float, data) if (data is not None) else str('—'),
value_fn=lambda data, _: cast(float, data) if (data is not None) else None,
entity_registry_enabled_default=False,
),
WundergroundPWSSensorEntityDescription(
key="narrative",
name="Forecast Summary",
feature=FEATURE_FORECAST_DAYPART,
icon="mdi:gauge",
value_fn=lambda data, _: cast(str, data) if (data is not None) else str('—'),
value_fn=lambda data, _: cast(str, data) if (data is not None) else None,
entity_registry_enabled_default=False,
),
WundergroundPWSSensorEntityDescription(
Expand All @@ -62,7 +62,7 @@
icon="mdi:weather-windy",
device_class=SensorDeviceClass.WIND_SPEED,
unit_fn=lambda metric: UnitOfSpeed.KILOMETERS_PER_HOUR if metric else UnitOfSpeed.MILES_PER_HOUR,
value_fn=lambda data, _: cast(float, data) if (data is not None) else str('—'),
value_fn=lambda data, _: cast(float, data) if (data is not None) else None,
entity_registry_enabled_default=False,
),
WundergroundPWSSensorEntityDescription(
Expand All @@ -72,7 +72,7 @@
icon="mdi:umbrella",
device_class=SensorDeviceClass.PRECIPITATION,
unit_fn=lambda metric: UnitOfLength.MILLIMETERS if metric else UnitOfLength.INCHES,
value_fn=lambda data, _: cast(float, data) if (data is not None) else str('—'),
value_fn=lambda data, _: cast(float, data) if (data is not None) else None,
entity_registry_enabled_default=False,
),
WundergroundPWSSensorEntityDescription(
Expand All @@ -81,7 +81,7 @@
feature=FEATURE_FORECAST_DAYPART,
icon="mdi:umbrella",
unit_fn=lambda _: PERCENTAGE,
value_fn=lambda data, _: cast(float, data) if (data is not None) else str('—'),
value_fn=lambda data, _: cast(float, data) if (data is not None) else None,
entity_registry_enabled_default=False,
),
]

0 comments on commit 52cbf9e

Please # to comment.