mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Mill use walrus operator (#63166)
* Mill use walrus operator Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net> * Mill use walrus operator Signed-off-by: Daniel Hjelseth Høyer <github@dahoiv.net>
This commit is contained in:
parent
0a0ca233c5
commit
8bf6aba1cf
@ -205,8 +205,7 @@ class LocalMillHeater(CoordinatorEntity, ClimateEntity):
|
||||
"""Initialize the thermostat."""
|
||||
super().__init__(coordinator)
|
||||
self._attr_name = coordinator.mill_data_connection.name
|
||||
if coordinator.mill_data_connection.mac_address:
|
||||
mac = self.coordinator.mill_data_connection.mac_address
|
||||
if mac := coordinator.mill_data_connection.mac_address:
|
||||
self._attr_unique_id = mac
|
||||
self._attr_device_info = DeviceInfo(
|
||||
connections={(CONNECTION_NETWORK_MAC, mac)},
|
||||
|
@ -203,8 +203,7 @@ class LocalMillSensor(CoordinatorEntity, SensorEntity):
|
||||
self._attr_name = (
|
||||
f"{coordinator.mill_data_connection.name} {entity_description.name}"
|
||||
)
|
||||
if coordinator.mill_data_connection.mac_address:
|
||||
mac = self.coordinator.mill_data_connection.mac_address
|
||||
if mac := coordinator.mill_data_connection.mac_address:
|
||||
self._attr_unique_id = f"{mac}_{entity_description.key}"
|
||||
self._attr_device_info = DeviceInfo(
|
||||
connections={(CONNECTION_NETWORK_MAC, mac)},
|
||||
|
Loading…
x
Reference in New Issue
Block a user