-
Notifications
You must be signed in to change notification settings - Fork 2
/
AdvCrownstoneState.py
34 lines (30 loc) · 1.55 KB
/
AdvCrownstoneState.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
from crownstone_core.packets.serviceDataParsers.containers.elements.AdvTypes import AdvType
class AdvCrownstoneState:
def __init__(self):
self.type = AdvType.CROWNSTONE_STATE
self.crownstoneId = None
self.switchState = None
self.flags = None
self.globalFlags = None
self.temperature = None
self.powerFactor = None
self.powerUsageReal = None
self.powerUsageApparent = None
self.accumulatedEnergy = None
self.timestamp = None
self.uniqueIdentifier = None
self.validation = None
def __str__(self):
return f"{self.type}\n"\
f"crownstoneId: {self.crownstoneId }\n" \
f"switchState: {self.switchState }\n" \
f"flags: {self.flags }\n" \
f"globalFlags: {self.globalFlags }\n" \
f"temperature: {self.temperature }\n" \
f"powerFactor: {self.powerFactor }\n" \
f"powerUsageReal: {self.powerUsageReal }\n" \
f"powerUsageApparent: {self.powerUsageApparent}\n" \
f"accumulatedEnergy: {self.accumulatedEnergy }\n" \
f"timestamp: {self.timestamp }\n" \
f"uniqueIdentifier: {self.uniqueIdentifier }\n" \
f"validation: {self.validation }\n"