Skip to content

Commit 4dd7ba0

Browse files
committed
Return the number of found devices from the start() method.
1 parent d01089f commit 4dd7ba0

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "powersensor-local"
3-
version = "1.0.1"
3+
version = "1.0.2"
44
description = "Network-local (non-cloud) interface for Powersensor devices"
55
authors = [
66
{ name = "Jade Mattsson", email = "jmattsson@dius.com.au" },

src/powersensor_local/devices.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,10 +124,16 @@ async def yourcallback(event: dict)
124124
value: Y.Z,
125125
durations_s: N.M,
126126
}
127+
128+
The start function returns the number of found gateway plugs.
129+
Powersensor devices aren't found directly as they are typically not
130+
on the network, but are instead detected when they relay data through
131+
a plug via long-range radio.
127132
"""
128133
self._event_cb = async_event_cb
129134
await self._on_scanned(await self._ps.scan())
130135
self._timer = self._Timer(EXPIRY_CHECK_INTERVAL_S, self._on_timer)
136+
return len(self._ips)
131137

132138
async def rescan(self):
133139
"""Performs a fresh scan of the network to discover added devices,

0 commit comments

Comments
 (0)