mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Fix wirelesstag switch arm/disarm (#59515)
This commit is contained in:
parent
34bc1298aa
commit
6bb816d226
@ -73,13 +73,13 @@ class WirelessTagPlatform:
|
|||||||
|
|
||||||
def arm(self, switch):
|
def arm(self, switch):
|
||||||
"""Arm entity sensor monitoring."""
|
"""Arm entity sensor monitoring."""
|
||||||
func_name = f"arm_{switch.sensor_type}"
|
func_name = f"arm_{switch.entity_description.key}"
|
||||||
if (arm_func := getattr(self.api, func_name)) is not None:
|
if (arm_func := getattr(self.api, func_name)) is not None:
|
||||||
arm_func(switch.tag_id, switch.tag_manager_mac)
|
arm_func(switch.tag_id, switch.tag_manager_mac)
|
||||||
|
|
||||||
def disarm(self, switch):
|
def disarm(self, switch):
|
||||||
"""Disarm entity sensor monitoring."""
|
"""Disarm entity sensor monitoring."""
|
||||||
func_name = f"disarm_{switch.sensor_type}"
|
func_name = f"disarm_{switch.entity_description.key}"
|
||||||
if (disarm_func := getattr(self.api, func_name)) is not None:
|
if (disarm_func := getattr(self.api, func_name)) is not None:
|
||||||
disarm_func(switch.tag_id, switch.tag_manager_mac)
|
disarm_func(switch.tag_id, switch.tag_manager_mac)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user