Skip to content

Commit c35c99c

Browse files
authored
Update dependencies (#945)
1 parent 9e2ac82 commit c35c99c

File tree

11 files changed

+700
-687
lines changed

11 files changed

+700
-687
lines changed

.github/actions/install-deps/action.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,13 @@ runs:
44
using: "composite"
55
steps:
66
- name: Install uv
7-
uses: astral-sh/setup-uv@v3
7+
uses: astral-sh/setup-uv@v6
88
with:
99
enable-cache: true
1010

1111
- name: Set up Python
1212
shell: bash
1313
run: |
14-
uv python install
1514
echo "PYTHON_VERSION=$(uv run python -c 'import platform; print(platform.python_version())')" >> "$GITHUB_ENV"
1615
1716
- name: Install dependencies with uv

custom_components/google_home/__init__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ async def async_setup_entry(hass: HomeAssistant, entry: GoogleHomeConfigEntry) -
4141
hass.data.setdefault(DOMAIN, {})
4242
_LOGGER.info(STARTUP_MESSAGE)
4343

44-
username = cast(str, entry.data.get(CONF_USERNAME))
45-
password = cast(str, entry.data.get(CONF_PASSWORD))
46-
android_id = cast(str, entry.data.get(CONF_ANDROID_ID))
47-
master_token = cast(str, entry.data.get(CONF_MASTER_TOKEN))
44+
username = cast("str", entry.data.get(CONF_USERNAME))
45+
password = cast("str", entry.data.get(CONF_PASSWORD))
46+
android_id = cast("str", entry.data.get(CONF_ANDROID_ID))
47+
master_token = cast("str", entry.data.get(CONF_MASTER_TOKEN))
4848
update_interval = cast(
49-
int, entry.options.get(CONF_UPDATE_INTERVAL, UPDATE_INTERVAL)
49+
"int", entry.options.get(CONF_UPDATE_INTERVAL, UPDATE_INTERVAL)
5050
)
5151

5252
_LOGGER.debug(

custom_components/google_home/api.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,14 @@
3030
)
3131
from .exceptions import InvalidMasterToken
3232
from .models import GoogleHomeDevice
33-
from .types import AlarmJsonDict, JsonDict, TimerJsonDict
3433

3534
if TYPE_CHECKING:
3635
from zeroconf import Zeroconf
3736

3837
from homeassistant.core import HomeAssistant
3938

39+
from .types import AlarmJsonDict, JsonDict, TimerJsonDict
40+
4041
_LOGGER: logging.Logger = logging.getLogger(__package__)
4142

4243

@@ -76,7 +77,7 @@ async def async_get_master_token(self) -> str:
7677
def _get_master_token() -> str | None:
7778
return self._client.get_master_token()
7879

79-
master_token = await self.hass.async_add_executor_job(_get_master_token) # type: ignore[arg-type]
80+
master_token = await self.hass.async_add_executor_job(_get_master_token)
8081
if master_token is None or is_aas_et(master_token) is False:
8182
raise InvalidMasterToken
8283
return master_token
@@ -87,7 +88,7 @@ async def async_get_access_token(self) -> str:
8788
def _get_access_token() -> str | None:
8889
return self._client.get_access_token()
8990

90-
access_token = await self.hass.async_add_executor_job(_get_access_token) # type: ignore[arg-type]
91+
access_token = await self.hass.async_add_executor_job(_get_access_token)
9192
if access_token is None:
9293
raise InvalidMasterToken
9394
return access_token
@@ -106,7 +107,7 @@ def _get_google_devices() -> list[Device]:
106107
force_homegraph_reload=True,
107108
)
108109

109-
google_devices = await self.hass.async_add_executor_job(_get_google_devices) # type: ignore[arg-type]
110+
google_devices = await self.hass.async_add_executor_job(_get_google_devices)
110111
self.google_devices = [
111112
GoogleHomeDevice(
112113
device_id=device.device_id,
@@ -125,7 +126,7 @@ async def get_android_id(self) -> str:
125126
def _get_android_id() -> str:
126127
return self._client.get_android_id()
127128

128-
return await self.hass.async_add_executor_job(_get_android_id) # type: ignore[arg-type]
129+
return await self.hass.async_add_executor_job(_get_android_id)
129130

130131
@staticmethod
131132
def create_url(ip_address: str, port: int, api_endpoint: str) -> str:
@@ -182,8 +183,8 @@ async def update_alarms_and_timers(
182183

183184
if response is not None:
184185
if JSON_TIMER in response and JSON_ALARM in response:
185-
device.set_timers(cast(list[TimerJsonDict], response[JSON_TIMER]))
186-
device.set_alarms(cast(list[AlarmJsonDict], response[JSON_ALARM]))
186+
device.set_timers(cast("list[TimerJsonDict]", response[JSON_TIMER]))
187+
device.set_alarms(cast("list[AlarmJsonDict]", response[JSON_ALARM]))
187188
_LOGGER.debug(
188189
"Successfully retrieved alarms and timers from %s. Response: %s",
189190
device.name,

custom_components/google_home/entity.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ def __init__(
3030
client: GlocaltokensApiClient,
3131
device_id: str,
3232
device_name: str,
33-
device_model: str,
33+
device_model: str | None,
3434
):
3535
"""Create Google Home base entity."""
3636
super().__init__(coordinator)
@@ -45,17 +45,17 @@ def label(self) -> str:
4545
"""Label to use for name and unique id."""
4646

4747
@property
48-
def name(self) -> str: # type: ignore[override]
48+
def name(self) -> str:
4949
"""Return the name of the sensor."""
5050
return f"{self.device_name} {self.label}"
5151

5252
@property
53-
def unique_id(self) -> str: # type: ignore[override]
53+
def unique_id(self) -> str:
5454
"""Return a unique ID to use for this entity."""
5555
return f"{self.device_id}/{self.label}"
5656

5757
@property
58-
def device_info(self) -> DeviceInfo | None: # type: ignore[override]
58+
def device_info(self) -> DeviceInfo | None:
5959
"""Return device info."""
6060
return {
6161
"identifiers": {(DOMAIN, self.device_id)},

custom_components/google_home/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"iot_class": "cloud_polling",
1919
"issue_tracker": "https://github.com/leikoilja/ha-google-home/issues",
2020
"requirements": [
21-
"glocaltokens==0.7.3"
21+
"glocaltokens==0.7.4"
2222
],
2323
"version": "1.12.1",
2424
"zeroconf": [

custom_components/google_home/number.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def label(self) -> str:
7474
return LABEL_ALARM_VOLUME
7575

7676
@property
77-
def icon(self) -> str: # type: ignore[override]
77+
def icon(self) -> str:
7878
"""Return the icon of the sensor."""
7979
device = self.get_device()
8080
if device is None:
@@ -89,7 +89,7 @@ def icon(self) -> str: # type: ignore[override]
8989
return ICON_ALARM_VOLUME_HIGH
9090

9191
@property
92-
def native_value(self) -> float: # type: ignore[override]
92+
def native_value(self) -> float:
9393
"""Return the current volume value."""
9494
device = self.get_device()
9595

custom_components/google_home/sensor.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,9 @@
3838
if TYPE_CHECKING:
3939
from homeassistant.core import HomeAssistant, ServiceCall
4040
from homeassistant.helpers.entity_platform import AddEntitiesCallback
41+
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
4142

43+
from .api import GlocaltokensApiClient
4244
from .types import (
4345
AlarmsAttributes,
4446
DeviceAttributes,
@@ -57,8 +59,10 @@ async def async_setup_entry(
5759
async_add_devices: AddEntitiesCallback,
5860
) -> bool:
5961
"""Set up sensor platform."""
60-
client = hass.data[DOMAIN][entry.entry_id][DATA_CLIENT]
61-
coordinator = hass.data[DOMAIN][entry.entry_id][DATA_COORDINATOR]
62+
client: GlocaltokensApiClient = hass.data[DOMAIN][entry.entry_id][DATA_CLIENT]
63+
coordinator: DataUpdateCoordinator[list[GoogleHomeDevice]] = hass.data[DOMAIN][
64+
entry.entry_id
65+
][DATA_COORDINATOR]
6266
sensors: list[Entity] = []
6367
for device in coordinator.data:
6468
sensors.append(
@@ -137,13 +141,13 @@ def label(self) -> str:
137141
return LABEL_DEVICE
138142

139143
@property
140-
def state(self) -> str | None: # type: ignore[override]
144+
def state(self) -> str | None:
141145
"""Return device IP address if any."""
142146
device = self.get_device()
143147
return device.ip_address if device else None
144148

145149
@property
146-
def extra_state_attributes(self) -> DeviceAttributes: # type: ignore[override]
150+
def extra_state_attributes(self) -> DeviceAttributes:
147151
"""Return the state attributes."""
148152
device = self.get_device()
149153
attributes: DeviceAttributes = {
@@ -193,7 +197,7 @@ def label(self) -> str:
193197
return LABEL_ALARMS
194198

195199
@property
196-
def state(self) -> str | None: # type: ignore[override]
200+
def state(self) -> str | None:
197201
"""Return next alarm if available."""
198202
device = self.get_device()
199203
if not device:
@@ -208,7 +212,7 @@ def state(self) -> str | None: # type: ignore[override]
208212
)
209213

210214
@property
211-
def extra_state_attributes(self) -> AlarmsAttributes: # type: ignore[override]
215+
def extra_state_attributes(self) -> AlarmsAttributes:
212216
"""Return the state attributes."""
213217
return {
214218
"next_alarm_status": self._get_next_alarm_status(),
@@ -279,7 +283,7 @@ def label(self) -> str:
279283
return LABEL_TIMERS
280284

281285
@property
282-
def state(self) -> str | None: # type: ignore[override]
286+
def state(self) -> str | None:
283287
"""Return next timer if available."""
284288
device = self.get_device()
285289
if not device:
@@ -292,7 +296,7 @@ def state(self) -> str | None: # type: ignore[override]
292296
)
293297

294298
@property
295-
def extra_state_attributes(self) -> TimersAttributes: # type: ignore[override]
299+
def extra_state_attributes(self) -> TimersAttributes:
296300
"""Return the state attributes."""
297301
return {
298302
"next_timer_status": self._get_next_timer_status(),

custom_components/google_home/switch.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,10 @@
2020
if TYPE_CHECKING:
2121
from homeassistant.core import HomeAssistant
2222
from homeassistant.helpers.entity_platform import AddEntitiesCallback
23+
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
2324

25+
from .api import GlocaltokensApiClient
26+
from .models import GoogleHomeDevice
2427
from .types import GoogleHomeConfigEntry
2528

2629
_LOGGER: logging.Logger = logging.getLogger(__package__)
@@ -32,8 +35,10 @@ async def async_setup_entry(
3235
async_add_devices: AddEntitiesCallback,
3336
) -> bool:
3437
"""Set up switch platform."""
35-
client = hass.data[DOMAIN][entry.entry_id][DATA_CLIENT]
36-
coordinator = hass.data[DOMAIN][entry.entry_id][DATA_COORDINATOR]
38+
client: GlocaltokensApiClient = hass.data[DOMAIN][entry.entry_id][DATA_CLIENT]
39+
coordinator: DataUpdateCoordinator[list[GoogleHomeDevice]] = hass.data[DOMAIN][
40+
entry.entry_id
41+
][DATA_COORDINATOR]
3742

3843
switches = [
3944
DoNotDisturbSwitch(
@@ -65,7 +70,7 @@ def label(self) -> str:
6570
return LABEL_DO_NOT_DISTURB
6671

6772
@property
68-
def is_on(self) -> bool: # type: ignore[override]
73+
def is_on(self) -> bool:
6974
"""Return true if Do Not Disturb Mode is on."""
7075
device = self.get_device()
7176

@@ -83,10 +88,10 @@ async def set_do_not_disturb(self, enable: bool) -> None:
8388

8489
await self.client.update_do_not_disturb(device=device, enable=enable)
8590

86-
async def async_turn_on(self, **kwargs: Any) -> None: # type: ignore[misc]
91+
async def async_turn_on(self, **kwargs: Any) -> None: # type: ignore[explicit-any]
8792
"""Turn the entity on."""
8893
await self.set_do_not_disturb(True)
8994

90-
async def async_turn_off(self, **kwargs: Any) -> None: # type: ignore[misc]
95+
async def async_turn_off(self, **kwargs: Any) -> None: # type: ignore[explicit-any]
9196
"""Turn the entity off."""
9297
await self.set_do_not_disturb(False)

hacs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
22
"name": "Google Home",
3-
"homeassistant": "2024.11.0",
3+
"homeassistant": "2025.6.0b1",
44
"render_readme": true
55
}

pyproject.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,22 +8,22 @@ description = "Home Assistant Google Home community integration"
88
authors = [{name = "Ilja Leiko", email = "[email protected]"}]
99
readme = "README.md"
1010
license = {text = "MIT"}
11-
requires-python = ">=3.12"
11+
requires-python = ">=3.13.2"
1212
dynamic = ["version"]
1313
dependencies = [
14-
"glocaltokens>=0.7.3",
15-
"homeassistant==2024.11.0",
14+
"glocaltokens>=0.7.4",
15+
"homeassistant==2025.6.0b1",
1616
]
1717

1818
[dependency-groups]
1919
dev = [
20-
"codespell>=2.3.0",
21-
"homeassistant-stubs==2024.11.0",
22-
"mypy>=1.13.0",
23-
"PyGithub>=2.4",
24-
"pylint>=3.3.1",
25-
"pytest>=8.3.3",
26-
"ruff>=0.7.2",
20+
"codespell>=2.4.1",
21+
"homeassistant-stubs==2025.6.0b1",
22+
"mypy>=1.15.0",
23+
"PyGithub>=2.6",
24+
"pylint>=3.3.7",
25+
"pytest>=8.3.5",
26+
"ruff>=0.11.11",
2727
"types-requests<2.31.0.7",
2828
"voluptuous-stubs>=0.1.1",
2929
]
@@ -32,8 +32,8 @@ dev = [
3232
source = "vcs"
3333

3434
[tool.ruff]
35-
required-version = ">=0.7.0"
36-
target-version = "py312"
35+
required-version = ">=0.11.0"
36+
target-version = "py313"
3737

3838
[tool.ruff.lint.isort]
3939
force-sort-within-sections = true
@@ -145,7 +145,7 @@ mark-parentheses = false
145145
max-complexity = 25
146146

147147
[tool.pylint.main]
148-
py-version = "3.12"
148+
py-version = "3.13"
149149
load-plugins = [
150150
"pylint.extensions.code_style",
151151
"pylint.extensions.typing",
@@ -178,7 +178,7 @@ max-line-length = 100
178178
min-similarity-lines = 7
179179

180180
[tool.mypy]
181-
python_version = "3.12"
181+
python_version = "3.13"
182182
show_error_codes = true
183183
strict = true
184184
disallow_any_explicit = true

0 commit comments

Comments
 (0)