Skip to content

Commit

Permalink
Set lock to unavailable when status is INVALID (#98)
Browse files Browse the repository at this point in the history
* Set lock to unavailable when status is INVALID (needs lib 0.8.2)
  • Loading branch information
WebSpider authored Oct 17, 2024
1 parent 6e22710 commit f993788
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 41 deletions.
10 changes: 8 additions & 2 deletions custom_components/myskoda/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@

from myskoda import common
from myskoda.models.air_conditioning import AirConditioning
from myskoda.models.common import DoorLockedState, OnOffState, OpenState
from myskoda.models.common import (
DoorLockedState,
OnOffState,
OpenState,
ChargerLockedState,
)
from myskoda.models.info import CapabilityId
from myskoda.models.status import Status

Expand Down Expand Up @@ -101,7 +106,8 @@ class ChargerLocked(AirConditioningBinarySensor):
@property
def is_on(self) -> bool | None: # noqa: D102
if ac := self._air_conditioning():
return ac.charger_lock_state != common.ChargerLockedState.LOCKED
if ac.charger_lock_state != ChargerLockedState.INVALID:
return ac.charger_lock_state != common.ChargerLockedState.LOCKED

@property
def icon(self) -> str: # noqa: D102
Expand Down
75 changes: 38 additions & 37 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ authors = ["Frederick Gnodtke <[email protected]>"]
readme = "README.md"

[tool.poetry.dependencies]
python = "~3.12"
python = "~3.12,<3.13"
beautifulsoup4 = "^4.12.3"
homeassistant = "^2024.10.0b0"
aiohttp = "^3.10.5"
pyjwt = "^2.9.0"
pyyaml = "^6.0.2"
asyncio = "^3.4.3"
voluptuous = "^0.15.2"
myskoda = "^0.8.1"
myskoda = "^0.8.2"


[tool.poetry.group.dev.dependencies]
Expand Down

0 comments on commit f993788

Please sign in to comment.