Enable strict typing for xiaomi_ble (#107948)
parent
45fec1d404
commit
0cc43d0915
|
@ -447,6 +447,7 @@ homeassistant.components.withings.*
|
|||
homeassistant.components.wiz.*
|
||||
homeassistant.components.wled.*
|
||||
homeassistant.components.worldclock.*
|
||||
homeassistant.components.xiaomi_ble.*
|
||||
homeassistant.components.yale_smart_alarm.*
|
||||
homeassistant.components.yalexs_ble.*
|
||||
homeassistant.components.youtube.*
|
||||
|
|
|
@ -128,7 +128,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
)
|
||||
)
|
||||
|
||||
async def _async_poll(service_info: BluetoothServiceInfoBleak):
|
||||
async def _async_poll(service_info: BluetoothServiceInfoBleak) -> SensorUpdate:
|
||||
# BluetoothServiceInfoBleak is defined in HA, otherwise would just pass it
|
||||
# directly to the Xiaomi code
|
||||
# Make sure the device we have is one that we can connect with
|
||||
|
|
|
@ -280,8 +280,8 @@ class XiaomiConfigFlow(ConfigFlow, domain=DOMAIN):
|
|||
# Otherwise there wasn't actually encryption so abort
|
||||
return self.async_abort(reason="reauth_successful")
|
||||
|
||||
def _async_get_or_create_entry(self, bindkey=None):
|
||||
data = {}
|
||||
def _async_get_or_create_entry(self, bindkey: str | None = None) -> FlowResult:
|
||||
data: dict[str, Any] = {}
|
||||
|
||||
if bindkey:
|
||||
data["bindkey"] = bindkey
|
||||
|
|
|
@ -65,7 +65,7 @@ async def async_validate_trigger_config(
|
|||
"""Validate trigger config."""
|
||||
device_id = config[CONF_DEVICE_ID]
|
||||
if model_data := _async_trigger_model_data(hass, device_id):
|
||||
return model_data.schema(config)
|
||||
return model_data.schema(config) # type: ignore[no-any-return]
|
||||
return config
|
||||
|
||||
|
||||
|
|
10
mypy.ini
10
mypy.ini
|
@ -4233,6 +4233,16 @@ disallow_untyped_defs = true
|
|||
warn_return_any = true
|
||||
warn_unreachable = true
|
||||
|
||||
[mypy-homeassistant.components.xiaomi_ble.*]
|
||||
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.yale_smart_alarm.*]
|
||||
check_untyped_defs = true
|
||||
disallow_incomplete_defs = true
|
||||
|
|
Loading…
Reference in New Issue