Remove the zha-quirks compatibility shims once a zha-quirks release with the entity APIs is required

Abierto
#980 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
38/100
Tipo de issue
Refactorización
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python
Área
backend

Línea de trabajo

Read the TODOs in zha/application/platforms/__init__.py and zha/application/platforms/sensor/__init__.py, then check the dependency lock for a zha-quirks release containing zigpy/zha-device-handlers#5410 and whether HA Core has stopped reading entity.endpoint in homeassistant/components/zha/websocket_api.py. Once both conditions hold, remove the shims and regenerate tests/data/devices/frient-a-s-splzb-141-0x00020009.json; compare the snapshot changes with the two fields noted in the issue.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

code quality quirks
Summary

zigpy/zha#919 and zigpy/zha#978 added two compatibility shims so that zha-quirks releases without zigpy/zha-device-handlers#5410 keep working. That PR is merged, but the newest zha-quirks release (2.3.0) predates it. The shims can be removed once every zha-quirks version that can run with ZHA includes it. In practice, that is when HA Core pins a zha-quirks release with it and zha's own lock uses one.

Changes
  • from_quirk in ZclPlatformEntity.__init__ (zha/application/platforms/__init__.py, TODO "remove this backwards compatibility shim after zha-device-handlers#5410 is merged"). Only zha-quirks releases before that PR pass this keyword.
  • The deprecated endpoint and targets_cluster on the RSSI/LQI sensors (zha/application/platforms/sensor/__init__.py, TODO "remove once zha-quirks only filters ZclPlatformEntity by endpoint/cluster and HA Core's websocket_get_groupable_devices no longer reads entity.endpoint"). The quirks half is done in zigpy/zha-device-handlers#5410: EntityFilter only checks endpoint and cluster on ZclPlatformEntity. The HA Core half is still open: websocket_get_groupable_devices (homeassistant/components/zha/websocket_api.py) still filters entities with entity_ref.entity_data.entity.endpoint.id == ep_id.
  • Snapshot: when zha's lock picks up the first zha-quirks release with that PR, regenerate tests/data/devices/frient-a-s-splzb-141-0x00020009.json. The frient quirk now replaces the device temperature entity with WholeDegreeDeviceTemperature. When this was checked against the PR branch, only class_name and suggested_display_precision changed in the snapshot.
Lenguaje dominante
Python
Estrellas
96
Forks
84
Merge medio
3 d 1 h
PR fusionados (30 d)
13

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de zigpy/zha

Todos los issues de zigpy/zha

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.