| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| """Implementation of homekit module.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from ...feature import Feature | ||
| from ..smartmodule import SmartModule | ||
|
|
||
|
|
||
| class HomeKit(SmartModule): | ||
| """Implementation of homekit module.""" | ||
|
|
||
| QUERY_GETTER_NAME: str = "get_homekit_info" | ||
| REQUIRED_COMPONENT = "homekit" | ||
|
|
||
| def _initialize_features(self) -> None: | ||
| """Initialize features after the initial update.""" | ||
| self._add_feature( | ||
| Feature( | ||
| self._device, | ||
| id="homekit_setup_code", | ||
| name="Homekit setup code", | ||
| container=self, | ||
| attribute_getter=lambda x: x.info["mfi_setup_code"], | ||
| type=Feature.Type.Sensor, | ||
| category=Feature.Category.Debug, | ||
| ) | ||
| ) | ||
|
|
||
| @property | ||
| def info(self) -> dict[str, str]: | ||
| """Homekit mfi setup info.""" | ||
| return self.data | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| """Implementation of homekit module.""" | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| from ..smartcammodule import SmartCamModule | ||
|
|
||
|
|
||
| class HomeKit(SmartCamModule): | ||
| """Implementation of homekit module.""" | ||
|
|
||
| REQUIRED_COMPONENT = "homekit" | ||
|
|
||
| @property | ||
| def info(self) -> dict[str, str]: | ||
| """Not supported, return empty dict.""" | ||
|
Comment thread
rytilahti marked this conversation as resolved.
|
||
| return {} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| from kasa import Module | ||
| from kasa.smart import SmartDevice | ||
|
|
||
| from ...device_fixtures import parametrize | ||
|
|
||
| homekit = parametrize( | ||
| "has homekit", component_filter="homekit", protocol_filter={"SMART"} | ||
| ) | ||
|
|
||
|
|
||
| @homekit | ||
| async def test_info(dev: SmartDevice): | ||
| """Test homekit info.""" | ||
| homekit = dev.modules.get(Module.HomeKit) | ||
| assert homekit | ||
| assert homekit.info |
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.