Skip to content

Commit da6fb3d

Browse files
committed
Added field specifiers
1 parent 56cb637 commit da6fb3d

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

LXMF/LXMF.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
APP_NAME = "lxmf"
22

3-
# WARNING! These specifications are floating and not
3+
# WARNING! These field specifiers are floating and not
44
# yet final! Consider highly experiemental, and expect
55
# them to change in the future! You have been warned :)
66

77
FIELD_EMBEDDED_LXMS = 0x01
88
FIELD_TELEMETRY = 0x02
9-
FIELD_ICON_APPEARANCE = 0x03
10-
FIELD_FILE_ATTACHMENTS = 0x04
11-
FIELD_IMAGE = 0x05
12-
FIELD_AUDIO = 0x06
13-
FIELD_THREAD = 0x07
9+
FIELD_TELEMETRY_STREAM = 0x03
10+
FIELD_ICON_APPEARANCE = 0x04
11+
FIELD_FILE_ATTACHMENTS = 0x05
12+
FIELD_IMAGE = 0x06
13+
FIELD_AUDIO = 0x07
14+
FIELD_THREAD = 0x08
15+
FIELD_COMMANDS = 0x09
16+
FIELD_RESULTS = 0x0A

LXMF/LXMessage.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,6 @@ def __init__(self, destination, source, content = "", title = "", fields = None,
111111

112112
self.set_title_from_string(title)
113113
self.set_content_from_string(content)
114-
115114
self.set_fields(fields)
116115

117116
self.payload = None
@@ -164,7 +163,7 @@ def content_as_string(self):
164163

165164
def set_fields(self, fields):
166165
if isinstance(fields, dict) or fields == None:
167-
self.fields = fields
166+
self.fields = fields or {}
168167
else:
169168
raise ValueError("LXMessage property \"fields\" can only be dict or None")
170169

0 commit comments

Comments
 (0)