Skip to content
Merged
Show file tree
Hide file tree
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
6 changes: 5 additions & 1 deletion integration_template/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class ExampleController(AbstractController[Device, Parameter]):
def __init__(self, dependencies: AbstractController.Dependencies):
super().__init__(dependencies)
self._discoveries: dict[UUID, Discovery] = {}
# e.g. self._cancel_zeroconf: Callable[[], None] | None = None

name = "Example"

Expand All @@ -46,11 +47,14 @@ def discoveries(self) -> dict[UUID, Discovery]:
async def start(self) -> None:
# Register discovery services, subscribe to protocol events, and reconcile the
# state of already-paired devices here.
# e.g. self.dependencies.zeroconf_discovery_service.add_listener("_example._tcp.local.", self)
# e.g. self._cancel_zeroconf = self.dependencies.zeroconf_discovery_service.register(
# self, {"_example._tcp.local."}
# )
...

async def stop(self) -> None:
# Cancel tasks and release every held resource.
# e.g. if self._cancel_zeroconf: self._cancel_zeroconf()
...

# Hub -> device ---------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ poetry build || code=1
echo "\nRunning poetry check:"
poetry check || code=1

${ci:+git diff --exit-code}
${ci:+git diff --exit-code} || code=1

exit $code
"""
Expand Down
Loading