mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Add sensor checks to pylint plugin (#76876)
This commit is contained in:
parent
5331af2143
commit
2630ff8fce
@ -1863,6 +1863,46 @@ _INHERITANCE_MATCH: dict[str, list[ClassTypeHintMatch]] = {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
"sensor": [
|
||||||
|
ClassTypeHintMatch(
|
||||||
|
base_class="Entity",
|
||||||
|
matches=_ENTITY_MATCH,
|
||||||
|
),
|
||||||
|
ClassTypeHintMatch(
|
||||||
|
base_class="SensorEntity",
|
||||||
|
matches=[
|
||||||
|
TypeHintMatch(
|
||||||
|
function_name="device_class",
|
||||||
|
return_type=["SensorDeviceClass", "str", None],
|
||||||
|
),
|
||||||
|
TypeHintMatch(
|
||||||
|
function_name="state_class",
|
||||||
|
return_type=["SensorStateClass", "str", None],
|
||||||
|
),
|
||||||
|
TypeHintMatch(
|
||||||
|
function_name="last_reset",
|
||||||
|
return_type=["datetime", None],
|
||||||
|
),
|
||||||
|
TypeHintMatch(
|
||||||
|
function_name="native_value",
|
||||||
|
return_type=[
|
||||||
|
"StateType",
|
||||||
|
"str",
|
||||||
|
"int",
|
||||||
|
"float",
|
||||||
|
None,
|
||||||
|
"date",
|
||||||
|
"datetime",
|
||||||
|
"Decimal",
|
||||||
|
],
|
||||||
|
),
|
||||||
|
TypeHintMatch(
|
||||||
|
function_name="native_unit_of_measurement",
|
||||||
|
return_type=["str", None],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
"siren": [
|
"siren": [
|
||||||
ClassTypeHintMatch(
|
ClassTypeHintMatch(
|
||||||
base_class="Entity",
|
base_class="Entity",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user