mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-21 19:09:04 +00:00
Allow to clear explicit image name (#3333)
The documentation says that passing null to `image` allows to clear the option. Currently `null` is not allowed leading to: Error: expected string or buffer for dictionary value @ data['image']. Got None While at it, also update type annotation to reflect what the API currently allows.
This commit is contained in:
@@ -156,7 +156,7 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
|
||||
return f"ghcr.io/home-assistant/{self.sys_machine}-homeassistant"
|
||||
|
||||
@image.setter
|
||||
def image(self, value: str) -> None:
|
||||
def image(self, value: Optional[str]) -> None:
|
||||
"""Set image name of Home Assistant container."""
|
||||
self._data[ATTR_IMAGE] = value
|
||||
|
||||
@@ -201,7 +201,7 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
|
||||
return self._data.get(ATTR_REFRESH_TOKEN)
|
||||
|
||||
@refresh_token.setter
|
||||
def refresh_token(self, value: str):
|
||||
def refresh_token(self, value: Optional[str]):
|
||||
"""Set Home Assistant refresh_token."""
|
||||
self._data[ATTR_REFRESH_TOKEN] = value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user