python-mobius 0.4.1__py3-none-any.whl → 0.4.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mobius/__init__.py +1 -1
- mobius/device.py +12 -4
- mobius/device_status.py +15 -6
- mobius/schedule.py +10 -0
- {python_mobius-0.4.1.dist-info → python_mobius-0.4.2.dist-info}/METADATA +2 -2
- {python_mobius-0.4.1.dist-info → python_mobius-0.4.2.dist-info}/RECORD +9 -9
- {python_mobius-0.4.1.dist-info → python_mobius-0.4.2.dist-info}/WHEEL +1 -1
- {python_mobius-0.4.1.dist-info → python_mobius-0.4.2.dist-info}/entry_points.txt +0 -0
- {python_mobius-0.4.1.dist-info → python_mobius-0.4.2.dist-info}/licenses/LICENSE +0 -0
mobius/__init__.py
CHANGED
mobius/device.py
CHANGED
|
@@ -843,9 +843,11 @@ class MobiusDevice:
|
|
|
843
843
|
build_rloc_address(), which is for the different case of only
|
|
844
844
|
having a 2-byte short address to encode into the prefix's last 2
|
|
845
845
|
bytes -- here the full 8-byte suffix is already present in the
|
|
846
|
-
entry, so it's used as-is); bytes 8-11 are a 4-byte
|
|
847
|
-
|
|
848
|
-
|
|
846
|
+
entry, so it's used as-is); bytes 8-11 are a 4-byte unsigned
|
|
847
|
+
"age" value in milliseconds -- confirmed to mean time since this
|
|
848
|
+
peer was last heard from over the mesh, a resetting value, not
|
|
849
|
+
time since first discovered (see MeshPeer's own docstring for
|
|
850
|
+
the full detail); bytes 12-13 are the 2-byte model
|
|
849
851
|
ID; bytes 14-27 are the 14-byte ASCII serial number, matching the
|
|
850
852
|
SerialNumberArray format used elsewhere in this library. All
|
|
851
853
|
multi-byte numeric fields are read little-endian -- confirmed
|
|
@@ -888,7 +890,13 @@ class MobiusDevice:
|
|
|
888
890
|
if len(entry) != 28:
|
|
889
891
|
continue
|
|
890
892
|
address = prefix + entry[0:8]
|
|
891
|
-
|
|
893
|
+
# Unsigned -- confirmed via reverse engineering the app's own
|
|
894
|
+
# network-troubleshooting screen, which explicitly treats this
|
|
895
|
+
# same 4-byte field as an unsigned value before ever using it
|
|
896
|
+
# for anything else. See MeshPeer's own docstring for the full,
|
|
897
|
+
# now-confirmed meaning (milliseconds since this peer was last
|
|
898
|
+
# heard from over the mesh).
|
|
899
|
+
age = struct.unpack("<I", entry[8:12])[0]
|
|
892
900
|
model_raw = struct.unpack("<h", entry[12:14])[0]
|
|
893
901
|
try:
|
|
894
902
|
serial = entry[14:28].decode("ascii").rstrip("\x00")
|
mobius/device_status.py
CHANGED
|
@@ -130,18 +130,27 @@ class MeshPeer:
|
|
|
130
130
|
`age` is only ever set by discover_networked_thread_devices() --
|
|
131
131
|
None from every other source of MeshPeer, including
|
|
132
132
|
discover_mesh_peers() and discover_mesh_peers_via_direct_connect().
|
|
133
|
-
Confirmed
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
133
|
+
Confirmed via reverse engineering the app's own network-
|
|
134
|
+
troubleshooting screen: milliseconds since this specific peer was
|
|
135
|
+
last heard from over the Thread mesh, as far as the connected
|
|
136
|
+
gateway currently knows -- NOT time since it was first discovered
|
|
137
|
+
or added to the tank. A RESETTING value, not a monotonic one: it
|
|
138
|
+
legitimately drops back toward zero whenever the mesh genuinely
|
|
139
|
+
receives fresh activity from that peer, which happens on its own
|
|
140
|
+
schedule, independent of whenever this is read. Two checks in
|
|
141
|
+
quick succession can validly show a SMALLER age the second time --
|
|
142
|
+
that's expected, not a parsing error. The app's own troubleshooting
|
|
143
|
+
screen treats anything over roughly 5 minutes (300000) as long
|
|
144
|
+
enough to flag that peer as currently unreachable/failed, which is
|
|
145
|
+
a reasonable rule of thumb for interpreting this value generally,
|
|
146
|
+
though not enforced by this library itself.
|
|
138
147
|
"""
|
|
139
148
|
serial: str
|
|
140
149
|
model_raw: int
|
|
141
150
|
model: Optional[Model] # None if model_raw doesn't match a known Model value
|
|
142
151
|
short_address: int
|
|
143
152
|
address: bytes # 16-byte Thread mesh-local IPv6, ready to pass to encode_coap_request()
|
|
144
|
-
age: Optional[int] = None #
|
|
153
|
+
age: Optional[int] = None # milliseconds since last heard from on the mesh -- see docstring above
|
|
145
154
|
|
|
146
155
|
|
|
147
156
|
@dataclass
|
mobius/schedule.py
CHANGED
|
@@ -235,6 +235,16 @@ class PumpSchedulePoint:
|
|
|
235
235
|
return None
|
|
236
236
|
return cls(time_minutes, flags, PumpPrimitiveValue.parse(data[3:]))
|
|
237
237
|
|
|
238
|
+
def has(self, flag: int) -> bool:
|
|
239
|
+
# Same flags field, same bit meanings as SchedulePoint's own
|
|
240
|
+
# has() (see this class's own docstring: identical wire format,
|
|
241
|
+
# just different primitiveData) -- an earlier version of this
|
|
242
|
+
# class omitted this entirely, which crashed mobius.cli's own
|
|
243
|
+
# --dump-schedule for pumps specifically (its own _format_flags()
|
|
244
|
+
# helper is shared between the light and pump branches, calling
|
|
245
|
+
# point.has() either way).
|
|
246
|
+
return (self.flags & flag) == flag
|
|
247
|
+
|
|
238
248
|
|
|
239
249
|
def get_active_pump_block(points: list[PumpSchedulePoint], minute_of_day: int) -> Optional[PumpSchedulePoint]:
|
|
240
250
|
"""
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
2
|
Name: python-mobius
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.2
|
|
4
4
|
Summary: Reverse-engineered Python client for the Mobius BLE protocol (EcoTech Marine VorTech/Radion, AquaIllumination, Neptune Systems, NYOS)
|
|
5
5
|
Project-URL: Homepage, https://code.r3pek.org/r3pek/python-mobius
|
|
6
6
|
Project-URL: Documentation, https://code.r3pek.org/r3pek/python-mobius/src/branch/main/documentation
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
mobius/__init__.py,sha256=
|
|
1
|
+
mobius/__init__.py,sha256=BpkSMm-tv7BC2F_vWHd-jym24Hsmwfd_OSMeJa2FEfQ,5722
|
|
2
2
|
mobius/cli.py,sha256=8XH-pVTX4KObzd0IOGXicT7KrcNEjm5xYZS8JOWfHDA,30726
|
|
3
3
|
mobius/coap.py,sha256=eXf_-9heQD1UjLyqZU9KA-c0jB50NGzAd8D7d6kFMb0,10750
|
|
4
4
|
mobius/constants.py,sha256=z_KrFev5vGD9-9lKn4J0nGVtzTmelGQ13bYlVcCdjm0,25217
|
|
5
5
|
mobius/crc.py,sha256=kLtAYWZvLbo5_p9ep08ZlLg5Yah8Q2qq0IwTvqbBGW0,2700
|
|
6
|
-
mobius/device.py,sha256=
|
|
7
|
-
mobius/device_status.py,sha256=
|
|
6
|
+
mobius/device.py,sha256=H5JGFtV90xu69jEOydMPqpj53e-5ws6TUVej0xd7WSg,79078
|
|
7
|
+
mobius/device_status.py,sha256=p1l6RpCcg_G4p9nudhSo8MzBSgqkH8m5_0qrnjsFQ2k,8374
|
|
8
8
|
mobius/discovery.py,sha256=LqHOEA_j1ZROuounn3PPmy8IEbpL6-N1TOW1MpoKg6A,11619
|
|
9
9
|
mobius/frame.py,sha256=UNLTHuzVue5b6L4nv1hWJTSbn5k8lETWdsiL_52yI0Q,6141
|
|
10
10
|
mobius/manufacturer.py,sha256=8-vBzckN8xmsPSMj5EWtOCXenbyQueoY5pnZHePgb_k,1937
|
|
@@ -13,9 +13,9 @@ mobius/modifiers.py,sha256=zWJCsjaJ4TtwS1QgQoRFH-ve1mykuPWn5KX4YQpNqco,7215
|
|
|
13
13
|
mobius/power.py,sha256=5l9ehjNCDrSsJjQkaU4M6pYnSMqw2FVF8Ogg6KIE5vQ,3844
|
|
14
14
|
mobius/pump_status.py,sha256=RWTl8ZViCFDbiFU2mX-WAIH_cWhZOZ0M2B0oYXnPx3Y,1598
|
|
15
15
|
mobius/relay.py,sha256=tMpV_67CYt9A1L_DPERzbqOgy3BOdG4NZpAG_IlefhY,16587
|
|
16
|
-
mobius/schedule.py,sha256=
|
|
17
|
-
python_mobius-0.4.
|
|
18
|
-
python_mobius-0.4.
|
|
19
|
-
python_mobius-0.4.
|
|
20
|
-
python_mobius-0.4.
|
|
21
|
-
python_mobius-0.4.
|
|
16
|
+
mobius/schedule.py,sha256=d5iAHvKuFDwfbrSptPx6viiA_lj2qGfWhsZwM_Bpr1k,10974
|
|
17
|
+
python_mobius-0.4.2.dist-info/METADATA,sha256=PBqNDTyqaF-wG4Q8YUZsMqsQ2TkBTFfOoUNKe0yYZG4,5952
|
|
18
|
+
python_mobius-0.4.2.dist-info/WHEEL,sha256=zOwg4jB6zX2kU910N-cMawjivD6tO8NEWvE12je1bVk,87
|
|
19
|
+
python_mobius-0.4.2.dist-info/entry_points.txt,sha256=Q2hlcek-bWm70zvd12v32essflPgC2su-dKDHAqbPoE,48
|
|
20
|
+
python_mobius-0.4.2.dist-info/licenses/LICENSE,sha256=7a72Msu2Q-TnoiFxemxEGkwafJGObk1W3rw9hzmyM_Y,17984
|
|
21
|
+
python_mobius-0.4.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|