Skip to content

Commit

Permalink
Added search to docs, fixed some sensors becoming unavailable when th…
Browse files Browse the repository at this point in the history
…eir value is 0
  • Loading branch information
signalkraft committed Nov 27, 2023
1 parent 39b60ae commit c008a86
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions custom_components/mypyllant/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class SystemOutdoorTemperatureSensor(SystemSensor):

@property
def native_value(self):
if self.system.outdoor_temperature:
if self.system.outdoor_temperature is not None:
return round(self.system.outdoor_temperature, 1)
else:
return None
Expand All @@ -216,7 +216,7 @@ class SystemWaterPressureSensor(SystemSensor):

@property
def native_value(self):
if self.system.water_pressure:
if self.system.water_pressure is not None:
return round(self.system.water_pressure, 1)
else:
return None
Expand Down Expand Up @@ -516,7 +516,7 @@ def name(self):

@property
def native_value(self):
if self.circuit.heating_curve:
if self.circuit.heating_curve is not None:
return round(self.circuit.heating_curve, 2)
else:
return None
Expand Down Expand Up @@ -772,7 +772,7 @@ def device_info(self):

@property
def native_value(self) -> float | None:
if self.energy_consumed:
if self.energy_consumed is not None:
return round(self.heat_energy_generated / self.energy_consumed, 1)
else:
return None
Expand Down
5 changes: 5 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ site_name: myPyllant Library & Home Assistant Component
site_url: https://signalkraft.com/mypyllant-component/
theme:
name: material
language: en
icon:
logo: material/rabbit-variant-outline
palette:
Expand All @@ -12,9 +13,13 @@ theme:
- content.tabs.link
- navigation.tabs
- navigation.tabs.sticky
- search.suggest
- search.highlight
- search.share
plugins:
- mkdocstrings
- social
- search
repo_url: https://github.com/signalkraft/mypyllant-component/
markdown_extensions:
- admonition
Expand Down

0 comments on commit c008a86

Please sign in to comment.