Add Mysensors battery sensor (#100749)

* Move child related stuff to MySensorsChildEntity

* Dispatch signal for newly discovered MySensors node

* Create battery entity for each MySensors node

* Removed ATTR_BATTERY_LEVEL attribute from each node sensor

Attribute is redundant with newly introduced battery sensor entity

* Apply suggestions from code review

---------

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Daniel Trnka 2023-09-24 22:50:13 +02:00 committed by GitHub
parent 6d624ecb46
commit 09729e8c46
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
18 changed files with 303 additions and 139 deletions

View file

@ -17,7 +17,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import setup_mysensors_platform
from .const import MYSENSORS_DISCOVERY, DiscoveryInfo
from .device import MySensorsEntity
from .device import MySensorsChildEntity
from .helpers import on_unload
@ -50,7 +50,7 @@ async def async_setup_entry(
)
class MySensorsRemote(MySensorsEntity, RemoteEntity):
class MySensorsRemote(MySensorsChildEntity, RemoteEntity):
"""Representation of a MySensors IR transceiver."""
_current_command: str | None = None