Skip to content

Commit db40713

Browse files
authored
default unit to None in sensor decorator (#1590)
Split out from: #1586 fix sensor unit beeing set to "" instead of None (HomeAssistant default)
1 parent b9e042e commit db40713

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

miio/devicestatus.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def __getattr__(self, item):
131131
return getattr(self._embedded[embed], prop)
132132

133133

134-
def sensor(name: str, *, unit: str = "", **kwargs):
134+
def sensor(name: str, *, unit: Optional[str] = None, **kwargs):
135135
"""Syntactic sugar to create SensorDescriptor objects.
136136
137137
The information can be used by users of the library to programmatically find out what

0 commit comments

Comments
 (0)