Skip to content

Commit

Permalink
Fix not setting hass to templates
Browse files Browse the repository at this point in the history
Fixes #91
  • Loading branch information
rautesamtr committed Jan 20, 2022
1 parent b28783c commit 393e9bf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion custom_components/thermal_comfort/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"domain": "thermal_comfort",
"name": "Thermal Comfort",
"version": "1.3.0",
"version": "1.3.1",
"documentation": "https://github.com/dolezsa/thermal_comfort/blob/master/README.md",
"issue_tracker": "https://github.com/dolezsa/thermal_comfort/issues",
"codeowners": ["@dolezsa"],
Expand Down
4 changes: 4 additions & 0 deletions custom_components/thermal_comfort/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ def extra_state_attributes(self):
async def async_added_to_hass(self):
"""Register callbacks."""
self._device.sensors.append(self)
if self._icon_template is not None:
self._icon_template.hass = self.hass
if self._entity_picture_template is not None:
self._entity_picture_template.hass = self.hass

async def async_update(self):
"""Update the state of the sensor."""
Expand Down

0 comments on commit 393e9bf

Please sign in to comment.