Clean up default ZHA entity names (#91841)

* Always use `Light` for lights, including subclasses

* Clean up other platforms

* Add a unit test to ensure all future entity classes have names

* Remove stale `_name`

* Address review feedback and rename `Open` to `Opening`
This commit is contained in:
puddly 2023-04-25 19:51:39 -04:00 committed by GitHub
parent da05763a5c
commit 6842cdcb65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 180 additions and 79 deletions

View file

@ -71,6 +71,8 @@ async def async_setup_entry(
class ZhaCover(ZhaEntity, CoverEntity):
"""Representation of a ZHA cover."""
_attr_name: str = "Cover"
def __init__(self, unique_id, zha_device, cluster_handlers, **kwargs):
"""Init this sensor."""
super().__init__(unique_id, zha_device, cluster_handlers, **kwargs)
@ -197,6 +199,7 @@ class Shade(ZhaEntity, CoverEntity):
"""ZHA Shade."""
_attr_device_class = CoverDeviceClass.SHADE
_attr_name: str = "Shade"
def __init__(
self,
@ -308,6 +311,8 @@ class Shade(ZhaEntity, CoverEntity):
class KeenVent(Shade):
"""Keen vent cover."""
_attr_name: str = "Keen vent"
_attr_device_class = CoverDeviceClass.DAMPER
async def async_open_cover(self, **kwargs: Any) -> None: