Add weather checks to pylint plugin (#76915)

This commit is contained in:
epenet 2022-08-17 16:27:47 +02:00 committed by GitHub
parent ef6b6e7850
commit eec0f3351a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1968,6 +1968,77 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
],
),
],
"weather": [
ClassTypeHintMatch(
base_class="Entity",
matches=_ENTITY_MATCH,
),
ClassTypeHintMatch(
base_class="WeatherEntity",
matches=[
TypeHintMatch(
function_name="native_temperature",
return_type=["float", None],
),
TypeHintMatch(
function_name="native_temperature_unit",
return_type=["str", None],
),
TypeHintMatch(
function_name="native_pressure",
return_type=["float", None],
),
TypeHintMatch(
function_name="native_pressure_unit",
return_type=["str", None],
),
TypeHintMatch(
function_name="humidity",
return_type=["float", None],
),
TypeHintMatch(
function_name="native_wind_speed",
return_type=["float", None],
),
TypeHintMatch(
function_name="native_wind_speed_unit",
return_type=["str", None],
),
TypeHintMatch(
function_name="wind_bearing",
return_type=["float", "str", None],
),
TypeHintMatch(
function_name="ozone",
return_type=["float", None],
),
TypeHintMatch(
function_name="native_visibility",
return_type=["float", None],
),
TypeHintMatch(
function_name="native_visibility_unit",
return_type=["str", None],
),
TypeHintMatch(
function_name="forecast",
return_type=["list[Forecast]", None],
),
TypeHintMatch(
function_name="native_precipitation_unit",
return_type=["str", None],
),
TypeHintMatch(
function_name="precision",
return_type="float",
),
TypeHintMatch(
function_name="condition",
return_type=["str", None],
),
],
),
],
}