Skip to content

Tasmota: Bugfix#1014

Open
sisamiwe wants to merge 1 commit intosmarthomeNG:developfrom
sisamiwe:tasmota_dev
Open

Tasmota: Bugfix#1014
sisamiwe wants to merge 1 commit intosmarthomeNG:developfrom
sisamiwe:tasmota_dev

Conversation

@sisamiwe
Copy link
Contributor

  • bump to 1.6.1
  • add try/except for extracting wifi signal

 - bump to 1.6.1
 - add try/except for extracting wifi signal
@sisamiwe sisamiwe requested a review from Morg42 October 12, 2025 14:19
wifi_signal = int(wifi_signal)
self.tasmota_devices[device]['wifi_signal'] = wifi_signal
try:
wifi_signal = payload.get('Signal')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was war denn das Problem - dass 'Signal' nicht als key vorhanden ist, oder dass payload = None ist?

In ersterem Fall macht das keinen Sinn, weil get keinen AttributeError wirft. Im zweiten Fall kannst du das get dann auch gleich rausnehmen - wifi_signal = payload['Signal'].

Oder was für ein Fehler ist da aufgetaucht?

@sisamiwe
Copy link
Contributor Author

Hey,

Der Fehler kam 1x pro Tag uns sah immer so aus:

2025-10-05 18:36:07 ERROR plugins.tasmota Exception AttributeError: 'str' object has no attribute 'get'
Traceback (most recent call last):
File "/usr/local/smarthome/plugins/tasmota/init.py", line 930, in on_mqtt_message
self._handle_wifi(tasmota_topic, payload['Wifi'])
File "/usr/local/smarthome/plugins/tasmota/init.py", line 1421, in _handle_wifi
wifi_signal = payload.get('Signal')
AttributeError: 'str' object has no attribute 'get'

@sisamiwe
Copy link
Contributor Author

deshalb hatte ich den AttributError abgefangen

@Morg42
Copy link
Member

Morg42 commented Oct 12, 2025

Das Problem ist an der Stelle, dass dein payload kein dict ist, sondern ein str. Würde ich mir mal ausgeben lassen und dann schauen, ob du nicht aus dem str auch die Daten bekommst, die du brauchst.

@onkelandy
Copy link
Member

@sisamiwe konntest da mal reinschauen?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants