Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss committed Mar 5, 2024
1 parent e9b3779 commit fa060d7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion custom_components/adaptive_cover/calculation.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,11 +150,11 @@ class ClimateCoverData:
def current_temperature(self):
"""Get current temp from entity."""
if self.temp_entity is not None:
temp = get_safe_state(self.hass, self.temp_entity)
if get_domain(self.temp_entity) == "climate":
temp = self.hass.states.get(self.temp_entity).attributes[
"current_temperature"
]
temp = get_safe_state(self.hass, self.temp_entity)
if temp is not None:
return float(temp)

Expand Down
6 changes: 3 additions & 3 deletions custom_components/adaptive_cover/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ class AdaptiveDataUpdateCoordinator(DataUpdateCoordinator[AdaptiveCoverData]):
def __init__(self, hass: HomeAssistant) -> None:
super().__init__(hass, LOGGER, name=DOMAIN)
self._switch_mode = True
self._cover_type = self.config_entry.data["sensor_type"]
self._climate_mode = self.config_entry.options[CONF_CLIMATE_MODE]
self._inverse_state = self.config_entry.options[CONF_INVERSE_STATE]
self._cover_type = self.config_entry.data.get("sensor_type")
self._climate_mode = self.config_entry.options.get(CONF_CLIMATE_MODE, False)
self._inverse_state = self.config_entry.options.get(CONF_INVERSE_STATE, False)

async def async_check_entity_state_change(
self, entity: str, old_state: State | None, new_state: State | None
Expand Down
4 changes: 2 additions & 2 deletions custom_components/adaptive_cover/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
"name": "Adaptive Cover",
"codeowners": ["@basbruss"],
"config_flow": true,
"dependencies": ["sun"],
"dependencies": ["sun","device_tracker","zone","climate","sensor","weather"],
"documentation": "https://github.com/basbruss/adaptive-cover",
"iot_class": "calculated",
"issue_tracker": "https://github.com/basbruss/adaptive-cover/issues",
"requirements": ["astral", "pandas"],
"version": "0.2.2"
"version": "0.3.0b0"
}

0 comments on commit fa060d7

Please sign in to comment.