Skip to content

Platinum quality upgrade with sensor platform, tests, and brand images - #7

Open
MichaelB2018 wants to merge 1 commit into
akhudek:mainfrom
MichaelB2018:platinum-upgrade
Open

Platinum quality upgrade with sensor platform, tests, and brand images#7
MichaelB2018 wants to merge 1 commit into
akhudek:mainfrom
MichaelB2018:platinum-upgrade

Conversation

@MichaelB2018

Copy link
Copy Markdown
Contributor

Summary

Major upgrade bringing the integration to Platinum quality scale standards. This is a complete rewrite of the integration while preserving the original domain and functionality.

What's New

Sensor Platform

  • Diagnostic sensors for zone count, time zone, DST status, location, and add-a-light mode on the hub device

Vendored Hub Library

  • Replaced the lc7001 PyPI dependency with a vendored hub.py (from lc7001 v1.0.5, MIT license by Ross Tyler)
  • Only runtime dependency is now cryptography>=42.0.0
  • Async TCP client with event-driven architecture (local_push)

Config Flow Improvements

  • DHCP auto-discovery support
  • Reauthentication flow (detects auth failures and prompts for new password)
  • Reconfigure flow (change hub IP without removing the integration)

Diagnostics

  • Hub status, zone properties, and authentication state with proper redaction

Brand Images

  • icon.png, icon@2x.png, and logo.png in both brand/ (repo root for HACS) and custom_components/legrand_rflc/brand/ (for HA local branding)

Full Test Suite

  • test_config_flow.py — user step, reauth, reconfigure, DHCP discovery, error handling
  • test_init.py — setup, teardown, unload
  • test_light.py — entity creation, state updates, commands, availability, brightness normalization
  • test_diagnostics.py — connected/disconnected output, auth redaction

Other Improvements

  • Entity model uses _attr_has_entity_name = True with translation keys
  • DeviceInfo on every entity (switch, dimmer, hub)
  • Brightness normalization: HA 0–255 ↔ LC7001 0–100
  • Transition/fade support on dimmers
  • Event-driven availability tracking (connected/disconnected/authenticated/unauthenticated)
  • Automatic reload on zone add/delete
  • quality_scale.yaml tracking all HA quality scale rules
  • PEP 561 py.typed marker
  • Updated manifest.json with integration_type: device, DHCP matchers, and iot_class: local_push

Breaking Changes

None — this is a drop-in upgrade. Existing users will see new sensor entities appear after updating.

Testing

Tests use pytest-homeassistant-custom-component. Run with:

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.

1 participant