consts.py
consts
¶
Bluetooth UUIDs and other constants used for communicating with the mug.
Attributes¶
ATTR_LABELS
module-attribute
¶
ATTR_LABELS = {
"name": "Device Name",
"meta": "Meta",
"battery": "Battery",
"firmware": "Firmware",
"led_colour": "LED Colour",
"liquid_state": "Liquid State",
"liquid_level": "Liquid Level",
"current_temp": "Current Temp",
"target_temp": "Target Temp",
"use_metric": "Use Metric",
"dsk": "DSK",
"udsk": "UDSK",
"date_time_zone": "Date Time + Time Zone",
"battery_voltage": "Voltage",
"volume_level": "Volume Level",
}
DEVICE_MODEL_NAMES
module-attribute
¶
DEVICE_MODEL_NAMES: dict[DeviceModel, str] = {
CUP_6_OZ: "Ember Cup",
MUG_1_10_OZ: "Ember Mug (10oz)",
MUG_1_14_OZ: "Ember Mug (14oz)",
MUG_2_10_OZ: "Ember Mug 2 (10oz)",
MUG_2_14_OZ: "Ember Mug 2 (14oz)",
TRAVEL_MUG_12_OZ: "Ember Travel Mug",
TUMBLER_16_OZ: "Ember Tumbler",
}
DEVICE_SERVICE_UUIDS
module-attribute
¶
DEVICE_SERVICE_UUIDS = (
str(STANDARD_SERVICE),
*TRAVEL_MUG_SERVICE_UUIDS,
)
EXTRA_ATTRS
module-attribute
¶
EXTRA_ATTRS = {
"battery_voltage",
"date_time_zone",
"udsk",
"dsk",
}
INITIAL_ATTRS
module-attribute
¶
INITIAL_ATTRS = {
"meta",
"udsk",
"dsk",
"date_time_zone",
"firmware",
}
LIQUID_STATE_LABELS
module-attribute
¶
LIQUID_STATE_LABELS: dict[int, str] = {
STANDBY: "Standby",
EMPTY: "Empty",
FILLING: "Filling",
COLD_NO_TEMP_CONTROL: "Cold (No control)",
COOLING: "Cooling",
HEATING: "Heating",
TARGET_TEMPERATURE: "Perfect",
WARM_NO_TEMP_CONTROL: "Warm (No control)",
}
MAC_ADDRESS_REGEX
module-attribute
¶
MAC_ADDRESS_REGEX = compile(
"^([0-9A-Fa-f]{2}:){5}([0-9A-Fa-f]{2})$"
)
MIN_MAX_TEMPS
module-attribute
¶
MIN_MAX_TEMPS = {
CELSIUS: MinMaxTemp(49, 63),
FAHRENHEIT: MinMaxTemp(120, 145),
}
MUG_NAME_REGEX
module-attribute
¶
MUG_NAME_REGEX = compile(
"^[A-Za-z0-9,.\\[\\]#()!\\\"\\';:|\\-_+<>%= ]{1,16}$"
)
PUSH_EVENT_BATTERY_IDS
module-attribute
¶
PUSH_EVENT_BATTERY_IDS = [
BATTERY_CHANGED,
CHARGER_CONNECTED,
CHARGER_DISCONNECTED,
]
TRAVEL_MUG_SERVICE_UUIDS
module-attribute
¶
TRAVEL_MUG_SERVICE_UUIDS = (
str(TRAVEL_MUG_SERVICE),
str(TRAVEL_MUG_SERVICE_OTHER),
)
UPDATE_ATTRS
module-attribute
¶
UPDATE_ATTRS = {
"name",
"led_colour",
"current_temp",
"target_temp",
"temperature_unit",
"battery",
"liquid_level",
"liquid_state",
}
Classes¶
DeviceColour
¶
Bases: str
, Enum
All colours possible found across models.
Source code in ember_mug/consts.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
Attributes¶
DeviceModel
¶
Bases: str
, Enum
Know device models.
Source code in ember_mug/consts.py
28 29 30 31 32 33 34 35 36 37 38 |
|
Attributes¶
DeviceType
¶
Bases: str
, Enum
Base device types.
Source code in ember_mug/consts.py
19 20 21 22 23 24 25 |
|
LiquidState
¶
Bases: IntEnum
Constants for liquid state codes.
Source code in ember_mug/consts.py
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 |
|
Attributes¶
MinMaxTemp
¶
MugCharacteristic
¶
Bases: IntEnum
Characteristic IDs for the Mug.
Source code in ember_mug/consts.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 |
|
Attributes¶
PushEvent
¶
Bases: IntEnum
IDs for Push Events.
Source code in ember_mug/consts.py
198 199 200 201 202 203 204 205 206 207 208 209 |
|
TemperatureUnit
¶
Bases: str
, Enum
Temperature Units.
Source code in ember_mug/consts.py
68 69 70 71 72 |
|
VolumeLevel
¶
Bases: str
, Enum
Class to manage volume levels.
Source code in ember_mug/consts.py
179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 |
|
Attributes¶
Functions¶
from_state
classmethod
¶
from_state(state: int) -> VolumeLevel
Build Volume level from int value.
Source code in ember_mug/consts.py
186 187 188 189 |
|