♻️ Extract shared ComwattEntity base for device_info #50

Merged
mat merged 1 commit from refactor/shared-entity-base into main 2026-07-10 18:16:17 +00:00
Owner

Pure, behavior-preserving refactor.

Extracts the duplicated device_info + _attr_has_entity_name from ComwattSensor and ComwattSwitch into a new entity.py ComwattEntity base. Uses the siteKind-superset device_info (harmless for switch devices, which have no siteKind). Independent of the other PRs.

  • 32/32 tests pass, ruff clean.
Pure, behavior-preserving refactor. Extracts the duplicated `device_info` + `_attr_has_entity_name` from `ComwattSensor` and `ComwattSwitch` into a new `entity.py` `ComwattEntity` base. Uses the `siteKind`-superset `device_info` (harmless for switch devices, which have no `siteKind`). Independent of the other PRs. - 32/32 tests pass, ruff clean.
♻️ Extract shared ComwattEntity base for device_info
All checks were successful
Validate / lint-ruff (push) Successful in 7s
Validate / test-pytest (push) Successful in 3m0s
Validate / type-check-mypy (push) Successful in 3m5s
Validate / lint-ruff (pull_request) Successful in 7s
Validate / test-pytest (pull_request) Successful in 2m59s
Validate / type-check-mypy (pull_request) Successful in 3m7s
ae216369c5
device_info and _attr_has_entity_name were duplicated between
ComwattSensor (sensor.py) and ComwattSwitch (switch.py). Move them
into a new ComwattEntity base in entity.py that both platforms extend.
mat merged commit 273106fd04 into main 2026-07-10 18:16:17 +00:00
mat referenced this pull request from a commit 2026-07-13 13:03:58 +00:00
mat referenced this pull request from a commit 2026-10-12 13:25:19 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
mat/homeassistant-comwatt!50
No description provided.