TISControlProtocol 1.0.68__tar.gz → 1.0.69__tar.gz
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.
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/PKG-INFO +1 -1
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/pyproject.toml +1 -1
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/display.py +51 -24
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/.gitignore +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/.vscode/c_cpp_properties.json +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/.vscode/launch.json +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/.vscode/settings.json +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/.vscode/tasks.json +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/LICENSE +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/MANIFEST.in +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/README.md +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/dev/pump_version.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/BytesHelper.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/__init__.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/AckCoordinator.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketDispatcher.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketExtractor.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/AnalogFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/AutoBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/BinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ClimateBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ClimateControlFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/ControlResponseHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/DiscoveryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/EnergyFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/FloorBinaryFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/HealthFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/LunaTempFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/RealTimeFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/SearchResponseHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/SecurityFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/UpdateResponseHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/UpdateSecurityHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/WeatherFeedbackHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketHandlers/__init__.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketProtocol.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketReceiver.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/PacketSender.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/ProtocolHandler.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/UpdateCoordinator.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/udp/__init__.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/__init__.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/api.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/__init__.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/bill_config_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/change_password_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/get_bill_config_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/get_key_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/password_dashboard.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/password_form_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/passwords_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/restart_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/scan_devices_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/shared.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/submit_password.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/tis_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/update_endpoint.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/crc.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/logo.png +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/package-lock.json +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/package.json +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/postcss.config.mjs +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/public/__init__.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/public/dashboard.css +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/public/password_dashboard_loader.js +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/shared.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/views/__init__.py +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/views/password_dashboard/index.html +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/views/password_dashboard/styles.css +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/views/password_form/index.html +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/views/password_form/styles.css +0 -0
- {tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/tests/test.py +0 -0
|
@@ -17,6 +17,7 @@ except (ImportError, RuntimeError) as e:
|
|
|
17
17
|
"Failed to load display dependencies. Display will be disabled. Error: %s", e
|
|
18
18
|
)
|
|
19
19
|
|
|
20
|
+
|
|
20
21
|
class TISDisplay:
|
|
21
22
|
def __init__(self, display_logo: str, version: str):
|
|
22
23
|
self.display_logo = display_logo
|
|
@@ -39,11 +40,11 @@ class TISDisplay:
|
|
|
39
40
|
logging.error(f"Error setting pin {pin} to {value}: {e}")
|
|
40
41
|
|
|
41
42
|
def send_command(self, cmd):
|
|
42
|
-
self._set_pin(23, 0)
|
|
43
|
+
self._set_pin(23, 0) # Command mode (0)
|
|
43
44
|
os.write(self.spi_fd, bytes([cmd]))
|
|
44
45
|
|
|
45
46
|
def send_data(self, data):
|
|
46
|
-
self._set_pin(23, 1)
|
|
47
|
+
self._set_pin(23, 1) # Data mode (1)
|
|
47
48
|
if isinstance(data, int):
|
|
48
49
|
os.write(self.spi_fd, bytes([data]))
|
|
49
50
|
else:
|
|
@@ -59,30 +60,30 @@ class TISDisplay:
|
|
|
59
60
|
time.sleep(0.1)
|
|
60
61
|
|
|
61
62
|
# ST7789 Initialization Sequence
|
|
62
|
-
self.send_command(0x01)
|
|
63
|
+
self.send_command(0x01) # SWRESET
|
|
63
64
|
time.sleep(0.15)
|
|
64
|
-
self.send_command(0x11)
|
|
65
|
+
self.send_command(0x11) # Sleep out
|
|
65
66
|
time.sleep(0.15)
|
|
66
67
|
|
|
67
|
-
self.send_command(0x3A)
|
|
68
|
-
self.send_data(0x55)
|
|
68
|
+
self.send_command(0x3A) # Color mode 16-bit
|
|
69
|
+
self.send_data(0x55) # 0x55 for RGB565
|
|
69
70
|
|
|
70
|
-
self.send_command(0x36)
|
|
71
|
-
self.send_data(0x00)
|
|
71
|
+
self.send_command(0x36) # Memory Access Control (MADCTL)
|
|
72
|
+
self.send_data(0x00) # Normal rotation
|
|
72
73
|
|
|
73
|
-
self.send_command(0x21)
|
|
74
|
-
self.send_command(0x13)
|
|
74
|
+
self.send_command(0x21) # INVON
|
|
75
|
+
self.send_command(0x13) # NORON
|
|
75
76
|
time.sleep(0.01)
|
|
76
|
-
self.send_command(0x29)
|
|
77
|
+
self.send_command(0x29) # Display on
|
|
77
78
|
time.sleep(0.1)
|
|
78
79
|
|
|
79
80
|
def set_window(self, x1, y1, x2, y2):
|
|
80
|
-
self.send_command(0x2A)
|
|
81
|
+
self.send_command(0x2A) # Column Address Set
|
|
81
82
|
self.send_data(bytearray([x1 >> 8, x1 & 0xFF, x2 >> 8, x2 & 0xFF]))
|
|
82
83
|
|
|
83
|
-
self.send_command(0x2B)
|
|
84
|
+
self.send_command(0x2B) # Row Address Set
|
|
84
85
|
self.send_data(bytearray([y1 >> 8, y1 & 0xFF, y2 >> 8, y2 & 0xFF]))
|
|
85
|
-
self.send_command(0x2C)
|
|
86
|
+
self.send_command(0x2C) # RAMWR
|
|
86
87
|
|
|
87
88
|
def set_display_image(self):
|
|
88
89
|
if self.display_logo:
|
|
@@ -94,27 +95,43 @@ class TISDisplay:
|
|
|
94
95
|
font = ImageFont.load_default(size=28)
|
|
95
96
|
except TypeError:
|
|
96
97
|
font = ImageFont.load_default()
|
|
97
|
-
|
|
98
|
+
|
|
98
99
|
x, y = 78, 235
|
|
99
100
|
draw.text((x, y), version_text, font=font, fill=(255, 255, 255))
|
|
100
|
-
img = img.rotate(
|
|
101
|
+
img = img.rotate(180, expand=True)
|
|
101
102
|
|
|
102
103
|
if img.size != (240, 320):
|
|
103
104
|
img = img.resize((240, 320))
|
|
104
105
|
|
|
105
106
|
r, g, b = img.split()
|
|
106
|
-
r_data =
|
|
107
|
-
|
|
108
|
-
|
|
107
|
+
r_data = (
|
|
108
|
+
list(r.getdata())
|
|
109
|
+
if not hasattr(r, "get_flattened_data")
|
|
110
|
+
else r.get_flattened_data()
|
|
111
|
+
)
|
|
112
|
+
g_data = (
|
|
113
|
+
list(g.getdata())
|
|
114
|
+
if not hasattr(g, "get_flattened_data")
|
|
115
|
+
else g.get_flattened_data()
|
|
116
|
+
)
|
|
117
|
+
b_data = (
|
|
118
|
+
list(b.getdata())
|
|
119
|
+
if not hasattr(b, "get_flattened_data")
|
|
120
|
+
else b.get_flattened_data()
|
|
121
|
+
)
|
|
109
122
|
|
|
110
123
|
rgb565 = bytearray(img.width * img.height * 2)
|
|
111
124
|
for i in range(len(r_data)):
|
|
112
|
-
pixel = (
|
|
125
|
+
pixel = (
|
|
126
|
+
((r_data[i] & 0xF8) << 8)
|
|
127
|
+
| ((g_data[i] & 0xFC) << 3)
|
|
128
|
+
| (b_data[i] >> 3)
|
|
129
|
+
)
|
|
113
130
|
rgb565[i * 2] = pixel >> 8
|
|
114
131
|
rgb565[i * 2 + 1] = pixel & 0xFF
|
|
115
132
|
|
|
116
133
|
self.set_window(0, 0, img.width - 1, img.height - 1)
|
|
117
|
-
self._set_pin(23, 1)
|
|
134
|
+
self._set_pin(23, 1) # Data mode
|
|
118
135
|
|
|
119
136
|
mv = memoryview(rgb565)
|
|
120
137
|
chunk_size = 4096
|
|
@@ -129,7 +146,9 @@ class TISDisplay:
|
|
|
129
146
|
SPI_IOC_WR_MODE = 0x40016B01
|
|
130
147
|
SPI_IOC_WR_MAX_SPEED_HZ = 0x40046B04
|
|
131
148
|
fcntl.ioctl(self.spi_fd, SPI_IOC_WR_MODE, struct.pack("B", 0))
|
|
132
|
-
fcntl.ioctl(
|
|
149
|
+
fcntl.ioctl(
|
|
150
|
+
self.spi_fd, SPI_IOC_WR_MAX_SPEED_HZ, struct.pack("I", 10000000)
|
|
151
|
+
)
|
|
133
152
|
|
|
134
153
|
# Initialize GPIOs via gpiod dynamically
|
|
135
154
|
self.chip_path = None
|
|
@@ -151,12 +170,20 @@ class TISDisplay:
|
|
|
151
170
|
self.req_dc = gpiod.request_lines(
|
|
152
171
|
self.chip_path,
|
|
153
172
|
consumer="display_dc",
|
|
154
|
-
config={
|
|
173
|
+
config={
|
|
174
|
+
23: gpiod.LineSettings(
|
|
175
|
+
direction=Direction.OUTPUT, output_value=Value.INACTIVE
|
|
176
|
+
)
|
|
177
|
+
},
|
|
155
178
|
)
|
|
156
179
|
self.req_rst = gpiod.request_lines(
|
|
157
180
|
self.chip_path,
|
|
158
181
|
consumer="display_rst",
|
|
159
|
-
config={
|
|
182
|
+
config={
|
|
183
|
+
25: gpiod.LineSettings(
|
|
184
|
+
direction=Direction.OUTPUT, output_value=Value.INACTIVE
|
|
185
|
+
)
|
|
186
|
+
},
|
|
160
187
|
)
|
|
161
188
|
|
|
162
189
|
try:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/BytesHelper.py
RENAMED
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/Protocols/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/shared.py
RENAMED
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/apis/tis_endpoint.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/package-lock.json
RENAMED
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/postcss.config.mjs
RENAMED
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/public/__init__.py
RENAMED
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/public/dashboard.css
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{tiscontrolprotocol-1.0.68 → tiscontrolprotocol-1.0.69}/src/TISControlProtocol/views/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|