Skip to content

Fix unencrypted Zeroconf payload detection - #1886

Open
Korshikov wants to merge 1 commit into
AlexxIT:masterfrom
Korshikov:fix/zeroconf-encrypt-flag
Open

Korshikov wants to merge 1 commit into
AlexxIT:masterfrom
Korshikov:fix/zeroconf-encrypt-flag

Conversation

@Korshikov

@Korshikov Korshikov commented Sep 18, 2026

Copy link
Copy Markdown

Fixes #1885

Summary

  • Normalize string values of the Zeroconf encrypt TXT property.
  • Preserve support for native boolean values.
  • Parse "false" payloads through the existing plaintext JSON path.
  • Add a regression test covering both False and "false".

Background

Some devices, including the SONOFF SAWF-08P, advertise the Zeroconf property as:

encrypt=false

After TXT properties are decoded, this becomes the Python string "false". The previous truthiness check treated that non-empty string as encrypted and attempted to access a nonexistent iv, causing repeated KeyError: 'iv' messages.

The payload itself is valid plaintext telemetry containing temperature, humidity, and CO₂ values.

Testing

98 passed

Tested with Python 3.14 and Home Assistant 2026.9.2.

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.

SAWF-08P plaintext Zeroconf payloads raise KeyError: 'iv'

1 participant