Check before casting to float & add integration type to bsblan (#97210)

This commit is contained in:
Jan-Philipp Benecke 2023-07-25 16:11:37 +02:00 committed by GitHub
parent 8d6c4e3306
commit c2f9070f40
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 1 deletions

View File

@ -106,6 +106,10 @@ class BSBLANClimate(
@property @property
def current_temperature(self) -> float | None: def current_temperature(self) -> float | None:
"""Return the current temperature.""" """Return the current temperature."""
if self.coordinator.data.current_temperature.value == "---":
# device returns no current temperature
return None
return float(self.coordinator.data.current_temperature.value) return float(self.coordinator.data.current_temperature.value)
@property @property

View File

@ -4,6 +4,7 @@
"codeowners": ["@liudger"], "codeowners": ["@liudger"],
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/bsblan", "documentation": "https://www.home-assistant.io/integrations/bsblan",
"integration_type": "device",
"iot_class": "local_polling", "iot_class": "local_polling",
"loggers": ["bsblan"], "loggers": ["bsblan"],
"requirements": ["python-bsblan==0.5.11"] "requirements": ["python-bsblan==0.5.11"]

View File

@ -703,7 +703,7 @@
}, },
"bsblan": { "bsblan": {
"name": "BSB-Lan", "name": "BSB-Lan",
"integration_type": "hub", "integration_type": "device",
"config_flow": true, "config_flow": true,
"iot_class": "local_polling" "iot_class": "local_polling"
}, },