mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-12-24 04:19:03 +00:00
Bump to python 3.10 and alpine 3.16 (#3791)
* Bump to python 3.10 * 3.10 is not a number * Musllinux wheels link * Revert attrs 22.1.0 -> 21.2.0 for wheel * Revert cryptography for wheel & pylint fix * Precommit and devcontainer to 3.10 * pyupgrade rewriting things * revert * Update builder.yml * fix rust * Update builder.yml Co-authored-by: Pascal Vizeli <pvizeli@syshack.ch>
This commit is contained in:
@@ -6,7 +6,6 @@ from pathlib import Path
|
||||
import shutil
|
||||
import tarfile
|
||||
from tempfile import TemporaryDirectory
|
||||
from typing import Optional
|
||||
from uuid import UUID
|
||||
|
||||
from awesomeversion import AwesomeVersion, AwesomeVersionException
|
||||
@@ -158,7 +157,7 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
|
||||
self._data[ATTR_WATCHDOG] = value
|
||||
|
||||
@property
|
||||
def latest_version(self) -> Optional[AwesomeVersion]:
|
||||
def latest_version(self) -> AwesomeVersion | None:
|
||||
"""Return last available version of Home Assistant."""
|
||||
return self.sys_updater.version_homeassistant
|
||||
|
||||
@@ -170,12 +169,12 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
|
||||
return f"ghcr.io/home-assistant/{self.sys_machine}-homeassistant"
|
||||
|
||||
@image.setter
|
||||
def image(self, value: Optional[str]) -> None:
|
||||
def image(self, value: str | None) -> None:
|
||||
"""Set image name of Home Assistant container."""
|
||||
self._data[ATTR_IMAGE] = value
|
||||
|
||||
@property
|
||||
def version(self) -> Optional[AwesomeVersion]:
|
||||
def version(self) -> AwesomeVersion | None:
|
||||
"""Return version of local version."""
|
||||
return self._data.get(ATTR_VERSION)
|
||||
|
||||
@@ -200,7 +199,7 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
|
||||
return self._data[ATTR_UUID]
|
||||
|
||||
@property
|
||||
def supervisor_token(self) -> Optional[str]:
|
||||
def supervisor_token(self) -> str | None:
|
||||
"""Return an access token for the Supervisor API."""
|
||||
return self._data.get(ATTR_ACCESS_TOKEN)
|
||||
|
||||
@@ -210,12 +209,12 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
|
||||
self._data[ATTR_ACCESS_TOKEN] = value
|
||||
|
||||
@property
|
||||
def refresh_token(self) -> Optional[str]:
|
||||
def refresh_token(self) -> str | None:
|
||||
"""Return the refresh token to authenticate with Home Assistant."""
|
||||
return self._data.get(ATTR_REFRESH_TOKEN)
|
||||
|
||||
@refresh_token.setter
|
||||
def refresh_token(self, value: Optional[str]):
|
||||
def refresh_token(self, value: str | None):
|
||||
"""Set Home Assistant refresh_token."""
|
||||
self._data[ATTR_REFRESH_TOKEN] = value
|
||||
|
||||
@@ -230,22 +229,22 @@ class HomeAssistant(FileConfiguration, CoreSysAttributes):
|
||||
return Path(self.sys_config.path_extern_tmp, "homeassistant_pulse")
|
||||
|
||||
@property
|
||||
def audio_output(self) -> Optional[str]:
|
||||
def audio_output(self) -> str | None:
|
||||
"""Return a pulse profile for output or None."""
|
||||
return self._data[ATTR_AUDIO_OUTPUT]
|
||||
|
||||
@audio_output.setter
|
||||
def audio_output(self, value: Optional[str]):
|
||||
def audio_output(self, value: str | None):
|
||||
"""Set audio output profile settings."""
|
||||
self._data[ATTR_AUDIO_OUTPUT] = value
|
||||
|
||||
@property
|
||||
def audio_input(self) -> Optional[str]:
|
||||
def audio_input(self) -> str | None:
|
||||
"""Return pulse profile for input or None."""
|
||||
return self._data[ATTR_AUDIO_INPUT]
|
||||
|
||||
@audio_input.setter
|
||||
def audio_input(self, value: Optional[str]):
|
||||
def audio_input(self, value: str | None):
|
||||
"""Set audio input settings."""
|
||||
self._data[ATTR_AUDIO_INPUT] = value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user