Skip to content

Add motion sensor to known categories #1176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions kasa/smart/smartchilddevice.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"subg.trigger.contact-sensor": DeviceType.Sensor,
"subg.trigger.temp-hmdt-sensor": DeviceType.Sensor,
"subg.trigger.water-leak-sensor": DeviceType.Sensor,
"subg.trigger.motion-sensor": DeviceType.Sensor,
"kasa.switch.outlet.sub-fan": DeviceType.Fan,
"kasa.switch.outlet.sub-dimmer": DeviceType.Dimmer,
"subg.trv": DeviceType.Thermostat,
Expand Down Expand Up @@ -87,9 +88,14 @@
@property
def device_type(self) -> DeviceType:
"""Return child device type."""
dev_type = self.CHILD_DEVICE_TYPE_MAP.get(self.sys_info["category"])
category = self.sys_info["category"]
dev_type = self.CHILD_DEVICE_TYPE_MAP.get(category)
if dev_type is None:
_LOGGER.warning("Unknown child device type, please open issue ")
_LOGGER.warning(

Check warning on line 94 in kasa/smart/smartchilddevice.py

View check run for this annotation

Codecov / codecov/patch

kasa/smart/smartchilddevice.py#L94

Added line #L94 was not covered by tests
"Unknown child device type %s for model %s, please open issue",
category,
self.model,
)
dev_type = DeviceType.Unknown
return dev_type

Expand Down
Loading