Enable strict typing on Bayesian (#79870)

* make bayesian static

* no longer private
This commit is contained in:
HarvsG 2022-10-09 19:30:38 +01:00 committed by GitHub
parent 77864ad80f
commit b86927a453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View File

@ -64,6 +64,7 @@ homeassistant.components.automation.*
homeassistant.components.awair.*
homeassistant.components.backup.*
homeassistant.components.baf.*
homeassistant.components.bayesian.*
homeassistant.components.binary_sensor.*
homeassistant.components.bluetooth.*
homeassistant.components.bluetooth_tracker.*

View File

@ -34,6 +34,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
from homeassistant.helpers.event import (
TrackTemplate,
TrackTemplateResult,
TrackTemplateResultInfo,
async_track_state_change_event,
async_track_template_result,
)
@ -189,7 +190,7 @@ class BayesianBinarySensor(BinarySensorEntity):
self._probability_threshold = probability_threshold
self._attr_device_class = device_class
self._attr_is_on = False
self._callbacks: list = []
self._callbacks: list[TrackTemplateResultInfo] = []
self.prior = prior
self.probability = prior

View File

@ -392,6 +392,16 @@ disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.bayesian.*]
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_subclassing_any = true
disallow_untyped_calls = true
disallow_untyped_decorators = true
disallow_untyped_defs = true
warn_return_any = true
warn_unreachable = true
[mypy-homeassistant.components.binary_sensor.*]
check_untyped_defs = true
disallow_incomplete_defs = true