Skip to content

Commit

Permalink
Bump lacrosse-view to 1.1.1 (#137282)
Browse files Browse the repository at this point in the history
  • Loading branch information
IceBotYT authored Feb 5, 2025
1 parent 83edee4 commit 41490df
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/lacrosse_view/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
"documentation": "https://www.home-assistant.io/integrations/lacrosse_view",
"iot_class": "cloud_polling",
"loggers": ["lacrosse_view"],
"requirements": ["lacrosse-view==1.0.4"]
"requirements": ["lacrosse-view==1.1.1"]
}
8 changes: 5 additions & 3 deletions homeassistant/components/lacrosse_view/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ class LaCrosseSensorEntityDescription(SensorEntityDescription):

def get_value(sensor: Sensor, field: str) -> float | int | str | None:
"""Get the value of a sensor field."""
field_data = sensor.data.get(field)
field_data = sensor.data.get(field) if sensor.data is not None else None
if field_data is None:
return None
value = field_data["values"][-1]["s"]
Expand Down Expand Up @@ -178,7 +178,7 @@ async def async_setup_entry(
continue

# if the API returns a different unit of measurement from the description, update it
if sensor.data.get(field) is not None:
if sensor.data is not None and sensor.data.get(field) is not None:
native_unit_of_measurement = UNIT_OF_MEASUREMENT_MAP.get(
sensor.data[field].get("unit")
)
Expand Down Expand Up @@ -240,7 +240,9 @@ def native_value(self) -> int | float | str | None:
@property
def available(self) -> bool:
"""Return True if entity is available."""
data = self.coordinator.data[self.index].data
return (
super().available
and self.entity_description.key in self.coordinator.data[self.index].data
and data is not None
and self.entity_description.key in data
)
2 changes: 1 addition & 1 deletion requirements_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion requirements_test_all.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 41490df

Please sign in to comment.