-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(experimental): add
force_update
as experimental setting in YAM…
- Loading branch information
Showing
5 changed files
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from custom_components.econnect_metronet.binary_sensor import AlertSensor | ||
from custom_components.econnect_metronet.const import DOMAIN | ||
|
||
|
||
class TestExperiments: | ||
def test_sensor_force_update_default(self, coordinator, config_entry, alarm_device): | ||
# Ensure the default is to not force any update | ||
entity = AlertSensor("device_tamper", 7, config_entry, "device_tamper", coordinator, alarm_device) | ||
assert entity._attr_force_update is False | ||
|
||
def test_sensor_force_update_on(self, hass, coordinator, config_entry, alarm_device): | ||
# Ensure you can force the entity update | ||
hass.data[DOMAIN] = {"force_update": True} | ||
entity = AlertSensor("device_tamper", 7, config_entry, "device_tamper", coordinator, alarm_device) | ||
assert entity._attr_force_update is True |