Clean up SmartTub (#51257)

* fix type hint

* pylint

* Update homeassistant/components/smarttub/binary_sensor.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

* Update homeassistant/components/smarttub/binary_sensor.py

Co-authored-by: Franck Nijhof <frenck@frenck.nl>

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Matt Zimmerman 2021-05-30 01:10:49 -07:00 committed by GitHub
parent c317854e86
commit 416d91ba85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,4 +1,6 @@
"""Platform for binary sensor integration."""
from __future__ import annotations
import logging
from smarttub import SpaError, SpaReminder
@ -144,7 +146,7 @@ class SmartTubError(SmartTubEntity, BinarySensorEntity):
)
@property
def error(self) -> SpaError:
def error(self) -> SpaError | None:
"""Return the underlying SpaError object for this entity."""
errors = self.coordinator.data[self.spa.id][ATTR_ERRORS]
if len(errors) == 0: