mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 05:07:41 +00:00
Fix implicit-return in hddtemp (#122919)
This commit is contained in:
parent
3f091470fd
commit
69a8c5dc9f
@ -6,6 +6,7 @@ from datetime import timedelta
|
|||||||
import logging
|
import logging
|
||||||
import socket
|
import socket
|
||||||
from telnetlib import Telnet # pylint: disable=deprecated-module
|
from telnetlib import Telnet # pylint: disable=deprecated-module
|
||||||
|
from typing import Any
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
@ -82,10 +83,11 @@ class HddTempSensor(SensorEntity):
|
|||||||
self._details = None
|
self._details = None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def extra_state_attributes(self):
|
def extra_state_attributes(self) -> dict[str, Any] | None:
|
||||||
"""Return the state attributes of the sensor."""
|
"""Return the state attributes of the sensor."""
|
||||||
if self._details is not None:
|
if self._details is not None:
|
||||||
return {ATTR_DEVICE: self._details[0], ATTR_MODEL: self._details[1]}
|
return {ATTR_DEVICE: self._details[0], ATTR_MODEL: self._details[1]}
|
||||||
|
return None
|
||||||
|
|
||||||
def update(self) -> None:
|
def update(self) -> None:
|
||||||
"""Get the latest data from HDDTemp daemon and updates the state."""
|
"""Get the latest data from HDDTemp daemon and updates the state."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user