Check against Switch attr not being None (#32647)

This commit is contained in:
Paulus Schoutsen 2020-03-10 11:28:11 -07:00 committed by GitHub
parent b2bb9cf134
commit 89fc430eec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,7 +103,7 @@ class SwitchDevice(ToggleEntity):
for prop, attr in PROP_TO_ATTR.items():
value = getattr(self, prop)
if value:
if value is not None:
data[attr] = value
return data