Add Async ADC PIR Support

- Add: Async function to get the current state of the ADC PIR sensor.
- Fix: Move ADC PIR state and config into proper dataclasses.
- Add: Add CLI test for passing bad quotes to feature set.
This commit is contained in:
Ryan Nitcher
2024-11-25 23:19:42 -07:00
parent d2ce2d20d4
commit 28080067db
3 changed files with 140 additions and 18 deletions

View File

@@ -68,6 +68,15 @@ async def test_motion_threshold(dev: IotDimmer, mocker: MockerFixture):
)
@dimmer_iot
async def test_motion_realtime(dev: IotDimmer, mocker: MockerFixture):
motion: Motion = dev.modules[Module.IotMotion]
query_helper = mocker.patch("kasa.iot.IotDimmer._query_helper")
await motion.get_pir_state()
query_helper.assert_called_with("smartlife.iot.PIR", "get_adc_value", None)
@dimmer_iot
def test_motion_feature(dev: IotDimmer):
assert Module.IotMotion in dev.modules