mirror of
https://github.com/home-assistant/core.git
synced 2026-07-06 22:36:33 +01:00
Migrate base entity attributes to StrEnum (#174633)
This commit is contained in:
@@ -41,9 +41,9 @@
|
||||
# name: test_all_entities[sensor.octocat_followers-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'octocat Followers',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat Followers',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'followers',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'followers',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_followers',
|
||||
@@ -95,9 +95,9 @@
|
||||
# name: test_all_entities[sensor.octocat_following-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'octocat Following',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat Following',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'users',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'users',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_following',
|
||||
@@ -149,10 +149,10 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_discussions-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Discussions',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Discussions',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'discussions',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'discussions',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_hello_world_discussions',
|
||||
@@ -204,10 +204,10 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_forks-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Forks',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Forks',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'forks',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'forks',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_hello_world_forks',
|
||||
@@ -259,10 +259,10 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_issues-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Issues',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Issues',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'issues',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'issues',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_hello_world_issues',
|
||||
@@ -312,8 +312,8 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_latest_commit-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Latest commit',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Latest commit',
|
||||
'sha': '6dcb09b5b57875f334f61aebed695e2e4193db5e',
|
||||
'url': 'https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e',
|
||||
}),
|
||||
@@ -365,8 +365,8 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_latest_discussion-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Latest discussion',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Latest discussion',
|
||||
'number': 1347,
|
||||
'url': 'https://github.com/octocat/Hello-World/discussions/1347',
|
||||
}),
|
||||
@@ -418,8 +418,8 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_latest_issue-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Latest issue',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Latest issue',
|
||||
'number': 1347,
|
||||
'url': 'https://github.com/octocat/Hello-World/issues/1347',
|
||||
}),
|
||||
@@ -471,8 +471,8 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_latest_pull_request-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Latest pull request',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Latest pull request',
|
||||
'number': 1347,
|
||||
'url': 'https://github.com/octocat/Hello-World/pull/1347',
|
||||
}),
|
||||
@@ -524,8 +524,8 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_latest_release-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Latest release',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Latest release',
|
||||
'tag': 'v1.0.0',
|
||||
'url': 'https://github.com/octocat/Hello-World/releases/v1.0.0',
|
||||
}),
|
||||
@@ -577,8 +577,8 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_latest_tag-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Latest tag',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Latest tag',
|
||||
'url': 'https://github.com/octocat/Hello-World/commit/6dcb09b5b57875f334f61aebed695e2e4193db5e',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
@@ -631,10 +631,10 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_merged_pull_requests-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Merged pull requests',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Merged pull requests',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.TOTAL: 'total'>,
|
||||
'unit_of_measurement': 'pull requests',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'pull requests',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_hello_world_merged_pull_requests',
|
||||
@@ -686,10 +686,10 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_pull_requests-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Pull requests',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Pull requests',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'pull requests',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'pull requests',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_hello_world_pull_requests',
|
||||
@@ -741,10 +741,10 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_stars-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Stars',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Stars',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'stars',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'stars',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_hello_world_stars',
|
||||
@@ -796,10 +796,10 @@
|
||||
# name: test_all_entities[sensor.octocat_hello_world_watchers-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'attribution': 'Data provided by the GitHub API',
|
||||
'friendly_name': 'octocat/Hello-World Watchers',
|
||||
<EntityStateAttribute.ATTRIBUTION: 'attribution'>: 'Data provided by the GitHub API',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat/Hello-World Watchers',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'watchers',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'watchers',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_hello_world_watchers',
|
||||
@@ -851,9 +851,9 @@
|
||||
# name: test_all_entities[sensor.octocat_public_gists-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'octocat Public gists',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat Public gists',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'gists',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'gists',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_public_gists',
|
||||
@@ -905,9 +905,9 @@
|
||||
# name: test_all_entities[sensor.octocat_public_repositories-state]
|
||||
StateSnapshot({
|
||||
'attributes': ReadOnlyDict({
|
||||
'friendly_name': 'octocat Public repositories',
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'octocat Public repositories',
|
||||
<SensorEntityCapabilityAttribute.STATE_CLASS: 'state_class'>: <SensorStateClass.MEASUREMENT: 'measurement'>,
|
||||
'unit_of_measurement': 'repositories',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'repositories',
|
||||
}),
|
||||
'context': <ANY>,
|
||||
'entity_id': 'sensor.octocat_public_repositories',
|
||||
|
||||
Reference in New Issue
Block a user