mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Add List access
sensor to Bring integration (#126844)
This commit is contained in:
parent
a95a542148
commit
39a0c0d96e
@ -12,6 +12,12 @@
|
|||||||
},
|
},
|
||||||
"list_language": {
|
"list_language": {
|
||||||
"default": "mdi:earth"
|
"default": "mdi:earth"
|
||||||
|
},
|
||||||
|
"list_access": {
|
||||||
|
"default": "mdi:account-lock",
|
||||||
|
"state": {
|
||||||
|
"shared": "mdi:account-group"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"todo": {
|
"todo": {
|
||||||
|
@ -40,6 +40,7 @@ class BringSensor(StrEnum):
|
|||||||
CONVENIENT = "convenient"
|
CONVENIENT = "convenient"
|
||||||
DISCOUNTED = "discounted"
|
DISCOUNTED = "discounted"
|
||||||
LIST_LANGUAGE = "list_language"
|
LIST_LANGUAGE = "list_language"
|
||||||
|
LIST_ACCESS = "list_access"
|
||||||
|
|
||||||
|
|
||||||
SENSOR_DESCRIPTIONS: tuple[BringSensorEntityDescription, ...] = (
|
SENSOR_DESCRIPTIONS: tuple[BringSensorEntityDescription, ...] = (
|
||||||
@ -73,6 +74,14 @@ SENSOR_DESCRIPTIONS: tuple[BringSensorEntityDescription, ...] = (
|
|||||||
options=[x.lower() for x in BRING_SUPPORTED_LOCALES],
|
options=[x.lower() for x in BRING_SUPPORTED_LOCALES],
|
||||||
device_class=SensorDeviceClass.ENUM,
|
device_class=SensorDeviceClass.ENUM,
|
||||||
),
|
),
|
||||||
|
BringSensorEntityDescription(
|
||||||
|
key=BringSensor.LIST_ACCESS,
|
||||||
|
translation_key=BringSensor.LIST_ACCESS,
|
||||||
|
value_fn=lambda lst, _: lst["status"].lower(),
|
||||||
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
|
options=["registered", "shared"],
|
||||||
|
device_class=SensorDeviceClass.ENUM,
|
||||||
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -61,6 +61,13 @@
|
|||||||
"sv-se": "Sweden",
|
"sv-se": "Sweden",
|
||||||
"tr-tr": "Türkiye"
|
"tr-tr": "Türkiye"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"list_access": {
|
||||||
|
"name": "List access",
|
||||||
|
"state": {
|
||||||
|
"registered": "Private",
|
||||||
|
"shared": "Shared"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -46,6 +46,62 @@
|
|||||||
'state': '2',
|
'state': '2',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_setup[sensor.baumarkt_list_access-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'registered',
|
||||||
|
'shared',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'sensor',
|
||||||
|
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
|
||||||
|
'entity_id': 'sensor.baumarkt_list_access',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'List access',
|
||||||
|
'platform': 'bring',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': <BringSensor.LIST_ACCESS: 'list_access'>,
|
||||||
|
'unique_id': '00000000-00000000-00000000-00000000_b4776778-7f6c-496e-951b-92a35d3db0dd_list_access',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_setup[sensor.baumarkt_list_access-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'enum',
|
||||||
|
'friendly_name': 'Baumarkt List access',
|
||||||
|
'options': list([
|
||||||
|
'registered',
|
||||||
|
'shared',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.baumarkt_list_access',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'registered',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_setup[sensor.baumarkt_on_occasion-entry]
|
# name: test_setup[sensor.baumarkt_on_occasion-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
@ -279,6 +335,62 @@
|
|||||||
'state': '2',
|
'state': '2',
|
||||||
})
|
})
|
||||||
# ---
|
# ---
|
||||||
|
# name: test_setup[sensor.einkauf_list_access-entry]
|
||||||
|
EntityRegistryEntrySnapshot({
|
||||||
|
'aliases': set({
|
||||||
|
}),
|
||||||
|
'area_id': None,
|
||||||
|
'capabilities': dict({
|
||||||
|
'options': list([
|
||||||
|
'registered',
|
||||||
|
'shared',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'config_entry_id': <ANY>,
|
||||||
|
'device_class': None,
|
||||||
|
'device_id': <ANY>,
|
||||||
|
'disabled_by': None,
|
||||||
|
'domain': 'sensor',
|
||||||
|
'entity_category': <EntityCategory.DIAGNOSTIC: 'diagnostic'>,
|
||||||
|
'entity_id': 'sensor.einkauf_list_access',
|
||||||
|
'has_entity_name': True,
|
||||||
|
'hidden_by': None,
|
||||||
|
'icon': None,
|
||||||
|
'id': <ANY>,
|
||||||
|
'labels': set({
|
||||||
|
}),
|
||||||
|
'name': None,
|
||||||
|
'options': dict({
|
||||||
|
}),
|
||||||
|
'original_device_class': <SensorDeviceClass.ENUM: 'enum'>,
|
||||||
|
'original_icon': None,
|
||||||
|
'original_name': 'List access',
|
||||||
|
'platform': 'bring',
|
||||||
|
'previous_unique_id': None,
|
||||||
|
'supported_features': 0,
|
||||||
|
'translation_key': <BringSensor.LIST_ACCESS: 'list_access'>,
|
||||||
|
'unique_id': '00000000-00000000-00000000-00000000_e542eef6-dba7-4c31-a52c-29e6ab9d83a5_list_access',
|
||||||
|
'unit_of_measurement': None,
|
||||||
|
})
|
||||||
|
# ---
|
||||||
|
# name: test_setup[sensor.einkauf_list_access-state]
|
||||||
|
StateSnapshot({
|
||||||
|
'attributes': ReadOnlyDict({
|
||||||
|
'device_class': 'enum',
|
||||||
|
'friendly_name': 'Einkauf List access',
|
||||||
|
'options': list([
|
||||||
|
'registered',
|
||||||
|
'shared',
|
||||||
|
]),
|
||||||
|
}),
|
||||||
|
'context': <ANY>,
|
||||||
|
'entity_id': 'sensor.einkauf_list_access',
|
||||||
|
'last_changed': <ANY>,
|
||||||
|
'last_reported': <ANY>,
|
||||||
|
'last_updated': <ANY>,
|
||||||
|
'state': 'registered',
|
||||||
|
})
|
||||||
|
# ---
|
||||||
# name: test_setup[sensor.einkauf_on_occasion-entry]
|
# name: test_setup[sensor.einkauf_on_occasion-entry]
|
||||||
EntityRegistryEntrySnapshot({
|
EntityRegistryEntrySnapshot({
|
||||||
'aliases': set({
|
'aliases': set({
|
||||||
|
Loading…
x
Reference in New Issue
Block a user