Skip to content

Commit

Permalink
Correct name of binary sensor base entity
Browse files Browse the repository at this point in the history
  • Loading branch information
elmurato committed Sep 9, 2023
1 parent 71924a4 commit 4ac3826
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions homeassistant/components/minecraft_server/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ async def async_setup_entry(

# Create entities list.
entities = [
MinecraftServerStatusBinarySensor(server, STATUS_BINARY_SENSOR_DESCRIPTION)
MinecraftServerBinarySensorEntity(server, STATUS_BINARY_SENSOR_DESCRIPTION)
]

# Add binary sensor entities.
async_add_entities(entities, True)


class MinecraftServerStatusBinarySensor(MinecraftServerEntity, BinarySensorEntity):
"""Representation of a Minecraft Server status binary sensor."""
class MinecraftServerBinarySensorEntity(MinecraftServerEntity, BinarySensorEntity):
"""Representation of a Minecraft Server binary sensor base entity."""

entity_description: MinecraftServerBinarySensorEntityDescription

Expand All @@ -55,12 +55,12 @@ def __init__(
server: MinecraftServer,
description: MinecraftServerBinarySensorEntityDescription,
) -> None:
"""Initialize status binary sensor."""
"""Initialize binary sensor base entity."""
super().__init__(server=server)
self.entity_description = description
self._attr_unique_id = f"{server.unique_id}-{description.key}"
self._attr_is_on = False

async def async_update(self) -> None:
"""Update status."""
"""Update binary sensor state."""
self._attr_is_on = self._server.online

0 comments on commit 4ac3826

Please sign in to comment.