Dan Davies
728a891e6c
Fix KeyError in MQTT publish handler dropping whole status update
...
_on_publish_received() indexes appliance.attributes["parameters"]
directly by parName when applying an incoming appliancestatus push:
appliance.attributes["parameters"][parameter["parName"]].update(parameter)
If the payload contains a parName that hasn't been seen/initialized
locally yet, this raises KeyError before self._hon.notify() is
reached, so the entire push message (not just that one parameter) is
silently dropped for that appliance.
In practice this reproduced reliably on a Haier washing machine
(HW90-B14959U1-UK) at end-of-cycle, where the push includes a
"programStats" parameter:
Exception ignored in: <class 'KeyError'>
Traceback (most recent call last):
File ".../awscrt/mqtt5.py", line 1540, in _on_publish
self._on_publish_cb(publish_data)
File ".../pyhon/connection/mqtt.py", line 109, in _on_publish_received
appliance.attributes["parameters"][parameter["parName"]].update(
KeyError: 'programStats'
Because the exception is swallowed by the underlying MQTT client as
"Exception ignored in", it fails silently with no log entry pointing
at the cause - the visible symptom is just that dependent entities
(e.g. door-open state bundled in the same push) never update.
Fix: use setdefault() instead of a raw index so an unseen parName
initializes its entry instead of raising.
2026-08-23 13:03:13 +01:00
addshore
afb5b8c3ea
Update for new hOn login
...
https://github.com/Andre0512/hon/issues/230
2024-07-10 12:39:18 +01:00
Andre Basche
63752e13d6
Fix connection failures
2024-04-09 22:47:28 +02:00
Andre Basche
86c2956d69
Handle mqtt connection events
2024-03-29 14:39:08 +01:00
Andre Basche
53691e383e
Use correct mobile id
2024-03-29 13:21:49 +01:00
Andre Basche
11da4ebfbc
Improve mqtt client
2024-03-29 01:10:27 +01:00
Andre Basche
bef55f7abc
Fix checks
2024-03-26 00:19:54 +01:00
Andre Basche
1583e6beaa
Fix missing update when using same client_id
2024-03-26 00:15:26 +01:00
Andre Basche
7e59f76784
subscribe to updates
2024-03-25 02:14:17 +01:00
Andre Basche
f108005a4d
Support cloud push with wss mqtt
2024-03-18 19:59:38 +01:00
Andre Basche
e225a850bc
Fix checks
2024-02-11 05:11:21 +01:00
Andre Basche
c4e8038652
Fix problems with refresh token
2024-02-11 05:11:21 +01:00
Andre Basche
767cbe35de
Set refresh token
2024-02-11 05:11:21 +01:00
Andre Basche
df27729c2e
Change mobile id
2024-02-11 05:11:21 +01:00
Andre Basche
e9f2bb9f4f
Send program name Andre0512/hon#124
2023-11-21 02:23:53 +01:00
Andre Basche
cfee10df5f
Improve logging for test api
2023-07-20 23:52:46 +02:00
Andre Basche
5a778373b6
Enable more pylint checks
2023-07-16 05:53:23 +02:00
Andre Basche
e1c8bc5835
Reduce complexity and line length for flake8
2023-07-16 04:42:29 +02:00
Andre Basche
442e7a07dd
Fix pylint check
2023-07-14 00:40:48 +02:00
Andre Basche
b0e3b15ff0
Add pylint checks
2023-07-12 19:36:32 +02:00
Andre Basche
3d5c8405ea
Improve error handling
2023-07-09 23:58:55 +02:00
Andre Basche
a10ab4423e
Add stricter mypy rules
2023-07-01 14:59:09 +02:00
Andre Basche
44f40c531e
Fix some minor issues
2023-06-29 22:08:51 +02:00
Andre Basche
b5d8a90d79
Fix messed up parameters in request
2023-06-28 20:25:52 +02:00
Andre Basche
9eb99f283b
Add more type hints
2023-06-28 19:02:11 +02:00
Andre Basche
ef67188b93
Create data archive and use it to test
2023-06-25 17:30:15 +02:00
Andre Basche
11988c73a6
Fix command parameter issue hon#63
2023-06-09 02:09:20 +02:00
Andre Basche
3c7ad3f395
Fix changed hOn login
2023-06-07 02:27:02 +02:00
Andre Basche
c2765fe953
Add rule handling
2023-05-21 02:25:43 +02:00
Andre Basche
9971fe95e2
Get appliance code from serial number
2023-05-20 13:24:24 +02:00
Andre Basche
9f130e2e85
Make 'code' attribute really optional
2023-05-19 00:48:08 +02:00
Andre Basche
af4fbdd8cd
Make 'code' attribute optional, fix hon#51
2023-05-16 20:46:46 +02:00
Andre Basche
22a98e1781
Add favorites request
2023-05-14 23:04:36 +02:00
Andre Basche
d350d639cc
Add maintenance cycle
2023-05-13 00:16:52 +02:00
Andre Basche
ea8f481b01
More general parsing
2023-05-06 16:08:36 +02:00
Andre Basche
7dcb34559b
Raise error if missing token
2023-04-24 21:50:25 +02:00
Andre Basche
d4c6ccdce3
Use parameter optional
2023-04-23 20:15:07 +02:00
Andre Basche
9594b9ebd8
Use firmware version optional
2023-04-23 19:28:56 +02:00
Andre Basche
ad864286fc
Use firmware id optional
2023-04-23 14:40:39 +02:00
Andre Basche
b04c601ad6
Add log for empty token
2023-04-21 23:51:35 +02:00
Andre Basche
46ff9be4a2
Fix code depts
2023-04-15 23:02:37 +02:00
Andre Basche
f54b7b2dbf
Add mypy checks
2023-04-15 15:57:36 +02:00
Andre Basche
b6ca12ebff
Use dataclass for login data
2023-04-15 14:37:27 +02:00
Andre Basche
4a0ee8569b
Refactor, add hon auth handler
2023-04-15 14:22:04 +02:00
Andre Basche
d26e33a055
Fix error in starting programs
2023-04-15 00:29:24 +02:00
Andre Basche
272556586e
Refresh token workaround because expires to fast
2023-04-14 23:15:27 +02:00
Andre Basche
e82c14ec99
Add some type hints
2023-04-13 23:35:43 +02:00
Andre Basche
970b94bfa7
Fix unclear session errors
2023-04-12 19:14:50 +02:00
Andre Basche
33454f68b8
Encode username/password
2023-04-12 02:10:37 +02:00
Andre Basche
6b2c60d552
Fix session issues
2023-04-12 01:07:33 +02:00