From d36d98937d2a3436eed74bf6eb95b24d90cb731e Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Tue, 24 Jan 2023 16:34:04 +0100 Subject: [PATCH] Replace `None` constants [minecraft_server] (#86540) --- homeassistant/components/minecraft_server/const.py | 3 --- homeassistant/components/minecraft_server/sensor.py | 11 ++--------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/homeassistant/components/minecraft_server/const.py b/homeassistant/components/minecraft_server/const.py index ab5d67dc426..8fe7c9b2791 100644 --- a/homeassistant/components/minecraft_server/const.py +++ b/homeassistant/components/minecraft_server/const.py @@ -36,6 +36,3 @@ SRV_RECORD_PREFIX = "_minecraft._tcp" UNIT_PLAYERS_MAX = "players" UNIT_PLAYERS_ONLINE = "players" -UNIT_PROTOCOL_VERSION = None -UNIT_VERSION = None -UNIT_MOTD = None diff --git a/homeassistant/components/minecraft_server/sensor.py b/homeassistant/components/minecraft_server/sensor.py index 36d78520565..2499dd8b75b 100644 --- a/homeassistant/components/minecraft_server/sensor.py +++ b/homeassistant/components/minecraft_server/sensor.py @@ -23,11 +23,8 @@ from .const import ( NAME_PLAYERS_ONLINE, NAME_PROTOCOL_VERSION, NAME_VERSION, - UNIT_MOTD, UNIT_PLAYERS_MAX, UNIT_PLAYERS_ONLINE, - UNIT_PROTOCOL_VERSION, - UNIT_VERSION, ) @@ -61,7 +58,7 @@ class MinecraftServerSensorEntity(MinecraftServerEntity, SensorEntity): server: MinecraftServer, type_name: str, icon: str, - unit: str | None, + unit: str | None = None, device_class: str | None = None, ) -> None: """Initialize sensor base entity.""" @@ -79,9 +76,7 @@ class MinecraftServerVersionSensor(MinecraftServerSensorEntity): def __init__(self, server: MinecraftServer) -> None: """Initialize version sensor.""" - super().__init__( - server=server, type_name=NAME_VERSION, icon=ICON_VERSION, unit=UNIT_VERSION - ) + super().__init__(server=server, type_name=NAME_VERSION, icon=ICON_VERSION) async def async_update(self) -> None: """Update version.""" @@ -97,7 +92,6 @@ class MinecraftServerProtocolVersionSensor(MinecraftServerSensorEntity): server=server, type_name=NAME_PROTOCOL_VERSION, icon=ICON_PROTOCOL_VERSION, - unit=UNIT_PROTOCOL_VERSION, ) async def async_update(self) -> None: @@ -173,7 +167,6 @@ class MinecraftServerMOTDSensor(MinecraftServerSensorEntity): server=server, type_name=NAME_MOTD, icon=ICON_MOTD, - unit=UNIT_MOTD, ) async def async_update(self) -> None: