Skip to content

Commit

Permalink
Update mypy-dev to 1.12.0a5 (home-assistant#127181)
Browse files Browse the repository at this point in the history
* Update mypy-dev to 1.12.0a5

* Fix enable_incomplete_feature

* Fix vlc_telnet

* Fix deconz
  • Loading branch information
cdce8p authored Oct 2, 2024
1 parent 21266e1 commit 4cd6813
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/deconz/entity.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ def available(self) -> bool:
"""Return True if device is available."""
if isinstance(self._device, PydeconzScene):
return self.hub.available
return self.hub.available and self._device.reachable # type: ignore[union-attr]
return self.hub.available and self._device.reachable


class DeconzSceneMixin(DeconzDevice[PydeconzScene]):
Expand Down
8 changes: 4 additions & 4 deletions homeassistant/components/vlc_telnet/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,13 @@ async def async_update(self) -> None:

# Fall back to filename.
if data_info := data.get("data"):
self._attr_media_title = _get_str(data_info, "filename")
media_title = _get_str(data_info, "filename")

# Strip out auth signatures if streaming local media
if (media_title := self.media_title) and (
pos := media_title.find("?authSig=")
) != -1:
if media_title and (pos := media_title.find("?authSig=")) != -1:
self._attr_media_title = media_title[:pos]
else:
self._attr_media_title = media_title

@catch_vlc_errors
async def async_media_seek(self, position: float) -> None:
Expand Down
1 change: 0 additions & 1 deletion mypy.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ platform = linux
plugins = pydantic.mypy
show_error_codes = true
follow_imports = normal
enable_incomplete_feature = NewGenericSyntax
local_partial_types = true
strict_equality = true
no_implicit_optional = true
Expand Down
2 changes: 1 addition & 1 deletion requirements_test.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ astroid==3.3.4
coverage==7.6.1
freezegun==1.5.1
mock-open==1.4.0
mypy-dev==1.12.0a3
mypy-dev==1.12.0a5
pre-commit==3.8.0
pydantic==1.10.18
pylint==3.3.1
Expand Down
8 changes: 3 additions & 5 deletions script/hassfest/mypy_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,9 @@
"plugins": "pydantic.mypy",
"show_error_codes": "true",
"follow_imports": "normal",
"enable_incomplete_feature": ", ".join( # noqa: FLY002
[
"NewGenericSyntax",
]
),
# "enable_incomplete_feature": ", ".join( # noqa: FLY002
# []
# ),
# Enable some checks globally.
"local_partial_types": "true",
"strict_equality": "true",
Expand Down

0 comments on commit 4cd6813

Please sign in to comment.