Skip to content

Commit

Permalink
Remove redundant hass object assignment to templates
Browse files Browse the repository at this point in the history
  • Loading branch information
dext0r committed Dec 12, 2024
1 parent a52fad9 commit a0df91d
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 8 deletions.
2 changes: 0 additions & 2 deletions custom_components/yandex_smart_home/capability_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,6 @@ def __init__(
self._entry_data = entry_data
self._config = config
self._value_template = value_template
if self._value_template:
self._value_template.hass = hass

self.device_id = device_id
self.instance = instance
Expand Down
6 changes: 1 addition & 5 deletions custom_components/yandex_smart_home/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -483,11 +483,7 @@ def _get_entry_alias(self, aliases: set[str] | None) -> str | None:
@property
def _error_code_template(self) -> Template | None:
"""Prepare template for error code."""
template: Template | None = self._config.get(CONF_ERROR_CODE_TEMPLATE)
if template is not None:
template.hass = self._hass

return template
return self._config.get(CONF_ERROR_CODE_TEMPLATE)


async def async_get_devices(hass: HomeAssistant, entry_data: ConfigEntryData) -> list[Device]:
Expand Down
1 change: 0 additions & 1 deletion custom_components/yandex_smart_home/property_custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,6 @@ def __init__(
self._entry_data = entry_data
self._config = config
self._value_template = value_template
self._value_template.hass = hass

self.device_id = device_id

Expand Down

0 comments on commit a0df91d

Please sign in to comment.