mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
Fix Volvo On Call lock state (#50832)
* Fix Volvo On Call: Locked shows as Unlocked #43260 and #49224 * Update binary_sensor.py Black changed 'Door lock' to "Door lock" (double quotes) * Update homeassistant/components/volvooncall/binary_sensor.py Co-authored-by: Martin Hjelmare <marhje52@gmail.com> * Update binary_sensor.py Amend code to pass pylint test Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
parent
99e58f3c18
commit
a03ee1e528
@ -16,7 +16,9 @@ class VolvoSensor(VolvoEntity, BinarySensorEntity):
|
||||
|
||||
@property
|
||||
def is_on(self):
|
||||
"""Return True if the binary sensor is on."""
|
||||
"""Return True if the binary sensor is on, but invert for the 'Door lock'."""
|
||||
if self.instrument.attr == "is_locked":
|
||||
return not self.instrument.is_on
|
||||
return self.instrument.is_on
|
||||
|
||||
@property
|
||||
|
Loading…
x
Reference in New Issue
Block a user