Add water_heater checks to pylint plugin (#76911)

pull/76942/head
epenet 2022-08-17 17:50:00 +02:00 committed by GitHub
parent 171893b484
commit ce07748979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 77 additions and 0 deletions

View File

@ -1999,6 +1999,83 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
],
),
],
"water_heater": [
ClassTypeHintMatch(
base_class="Entity",
matches=_ENTITY_MATCH,
),
ClassTypeHintMatch(
base_class="WaterHeaterEntity",
matches=[
TypeHintMatch(
function_name="precision",
return_type="float",
),
TypeHintMatch(
function_name="temperature_unit",
return_type="str",
),
TypeHintMatch(
function_name="current_operation",
return_type=["str", None],
),
TypeHintMatch(
function_name="operation_list",
return_type=["list[str]", None],
),
TypeHintMatch(
function_name="current_temperature",
return_type=["float", None],
),
TypeHintMatch(
function_name="target_temperature",
return_type=["float", None],
),
TypeHintMatch(
function_name="target_temperature_high",
return_type=["float", None],
),
TypeHintMatch(
function_name="target_temperature_low",
return_type=["float", None],
),
TypeHintMatch(
function_name="is_away_mode_on",
return_type=["bool", None],
),
TypeHintMatch(
function_name="set_temperature",
kwargs_type="Any",
return_type=None,
has_async_counterpart=True,
),
TypeHintMatch(
function_name="set_operation_mode",
arg_types={1: "str"},
return_type=None,
has_async_counterpart=True,
),
TypeHintMatch(
function_name="turn_away_mode_on",
return_type=None,
has_async_counterpart=True,
),
TypeHintMatch(
function_name="turn_away_mode_off",
return_type=None,
has_async_counterpart=True,
),
TypeHintMatch(
function_name="min_temp",
return_type="float",
),
TypeHintMatch(
function_name="max_temp",
return_type="float",
),
],
),
],
"weather": [
ClassTypeHintMatch(
base_class="Entity",