Skip to content

Commit

Permalink
Add weather checks to pylint plugin (home-assistant#76915)
Browse files Browse the repository at this point in the history
  • Loading branch information
epenet authored Aug 17, 2022
1 parent ef6b6e7 commit eec0f33
Showing 1 changed file with 71 additions and 0 deletions.
71 changes: 71 additions & 0 deletions pylint/plugins/hass_enforce_type_hints.py
Original file line number Diff line number Diff line change
Expand Up @@ -1968,6 +1968,77 @@ class 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],
),
],
),
],
}


Expand Down

0 comments on commit eec0f33

Please sign in to comment.