mirror of
https://github.com/home-assistant/core.git
synced 2025-07-13 00:07:10 +00:00
Add entity translations to Whois (#96824)
* Add entity translations to Whois * Fix tests
This commit is contained in:
parent
7c22225cd1
commit
0bdfb95d1d
@ -64,7 +64,7 @@ def _ensure_timezone(timestamp: datetime | None) -> datetime | None:
|
|||||||
SENSORS: tuple[WhoisSensorEntityDescription, ...] = (
|
SENSORS: tuple[WhoisSensorEntityDescription, ...] = (
|
||||||
WhoisSensorEntityDescription(
|
WhoisSensorEntityDescription(
|
||||||
key="admin",
|
key="admin",
|
||||||
name="Admin",
|
translation_key="admin",
|
||||||
icon="mdi:account-star",
|
icon="mdi:account-star",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -72,35 +72,35 @@ SENSORS: tuple[WhoisSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
WhoisSensorEntityDescription(
|
WhoisSensorEntityDescription(
|
||||||
key="creation_date",
|
key="creation_date",
|
||||||
name="Created",
|
translation_key="creation_date",
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
value_fn=lambda domain: _ensure_timezone(domain.creation_date),
|
value_fn=lambda domain: _ensure_timezone(domain.creation_date),
|
||||||
),
|
),
|
||||||
WhoisSensorEntityDescription(
|
WhoisSensorEntityDescription(
|
||||||
key="days_until_expiration",
|
key="days_until_expiration",
|
||||||
name="Days until expiration",
|
translation_key="days_until_expiration",
|
||||||
icon="mdi:calendar-clock",
|
icon="mdi:calendar-clock",
|
||||||
native_unit_of_measurement=UnitOfTime.DAYS,
|
native_unit_of_measurement=UnitOfTime.DAYS,
|
||||||
value_fn=_days_until_expiration,
|
value_fn=_days_until_expiration,
|
||||||
),
|
),
|
||||||
WhoisSensorEntityDescription(
|
WhoisSensorEntityDescription(
|
||||||
key="expiration_date",
|
key="expiration_date",
|
||||||
name="Expires",
|
translation_key="expiration_date",
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
value_fn=lambda domain: _ensure_timezone(domain.expiration_date),
|
value_fn=lambda domain: _ensure_timezone(domain.expiration_date),
|
||||||
),
|
),
|
||||||
WhoisSensorEntityDescription(
|
WhoisSensorEntityDescription(
|
||||||
key="last_updated",
|
key="last_updated",
|
||||||
name="Last updated",
|
translation_key="last_updated",
|
||||||
device_class=SensorDeviceClass.TIMESTAMP,
|
device_class=SensorDeviceClass.TIMESTAMP,
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
value_fn=lambda domain: _ensure_timezone(domain.last_updated),
|
value_fn=lambda domain: _ensure_timezone(domain.last_updated),
|
||||||
),
|
),
|
||||||
WhoisSensorEntityDescription(
|
WhoisSensorEntityDescription(
|
||||||
key="owner",
|
key="owner",
|
||||||
name="Owner",
|
translation_key="owner",
|
||||||
icon="mdi:account",
|
icon="mdi:account",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -108,7 +108,7 @@ SENSORS: tuple[WhoisSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
WhoisSensorEntityDescription(
|
WhoisSensorEntityDescription(
|
||||||
key="registrant",
|
key="registrant",
|
||||||
name="Registrant",
|
translation_key="registrant",
|
||||||
icon="mdi:account-edit",
|
icon="mdi:account-edit",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -116,7 +116,7 @@ SENSORS: tuple[WhoisSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
WhoisSensorEntityDescription(
|
WhoisSensorEntityDescription(
|
||||||
key="registrar",
|
key="registrar",
|
||||||
name="Registrar",
|
translation_key="registrar",
|
||||||
icon="mdi:store",
|
icon="mdi:store",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
@ -124,7 +124,7 @@ SENSORS: tuple[WhoisSensorEntityDescription, ...] = (
|
|||||||
),
|
),
|
||||||
WhoisSensorEntityDescription(
|
WhoisSensorEntityDescription(
|
||||||
key="reseller",
|
key="reseller",
|
||||||
name="Reseller",
|
translation_key="reseller",
|
||||||
icon="mdi:store",
|
icon="mdi:store",
|
||||||
entity_category=EntityCategory.DIAGNOSTIC,
|
entity_category=EntityCategory.DIAGNOSTIC,
|
||||||
entity_registry_enabled_default=False,
|
entity_registry_enabled_default=False,
|
||||||
|
@ -16,5 +16,36 @@
|
|||||||
"abort": {
|
"abort": {
|
||||||
"already_configured": "[%key:common::config_flow::abort::already_configured_service%]"
|
"already_configured": "[%key:common::config_flow::abort::already_configured_service%]"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"entity": {
|
||||||
|
"sensor": {
|
||||||
|
"admin": {
|
||||||
|
"name": "Admin"
|
||||||
|
},
|
||||||
|
"creation_date": {
|
||||||
|
"name": "Created"
|
||||||
|
},
|
||||||
|
"days_until_expiration": {
|
||||||
|
"name": "Days until expiration"
|
||||||
|
},
|
||||||
|
"expiration_date": {
|
||||||
|
"name": "Expires"
|
||||||
|
},
|
||||||
|
"last_updated": {
|
||||||
|
"name": "Last updated"
|
||||||
|
},
|
||||||
|
"owner": {
|
||||||
|
"name": "Owner"
|
||||||
|
},
|
||||||
|
"registrant": {
|
||||||
|
"name": "Registrant"
|
||||||
|
},
|
||||||
|
"registrar": {
|
||||||
|
"name": "Registrar"
|
||||||
|
},
|
||||||
|
"reseller": {
|
||||||
|
"name": "Reseller"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
'original_name': 'Admin',
|
'original_name': 'Admin',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'admin',
|
||||||
'unique_id': 'home-assistant.io_admin',
|
'unique_id': 'home-assistant.io_admin',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
@ -107,7 +107,7 @@
|
|||||||
'original_name': 'Created',
|
'original_name': 'Created',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'creation_date',
|
||||||
'unique_id': 'home-assistant.io_creation_date',
|
'unique_id': 'home-assistant.io_creation_date',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
@ -182,7 +182,7 @@
|
|||||||
'original_name': 'Days until expiration',
|
'original_name': 'Days until expiration',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'days_until_expiration',
|
||||||
'unique_id': 'home-assistant.io_days_until_expiration',
|
'unique_id': 'home-assistant.io_days_until_expiration',
|
||||||
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
|
'unit_of_measurement': <UnitOfTime.DAYS: 'd'>,
|
||||||
})
|
})
|
||||||
@ -252,7 +252,7 @@
|
|||||||
'original_name': 'Expires',
|
'original_name': 'Expires',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'expiration_date',
|
||||||
'unique_id': 'home-assistant.io_expiration_date',
|
'unique_id': 'home-assistant.io_expiration_date',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
@ -322,7 +322,7 @@
|
|||||||
'original_name': 'Last updated',
|
'original_name': 'Last updated',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'last_updated',
|
||||||
'unique_id': 'home-assistant.io_last_updated',
|
'unique_id': 'home-assistant.io_last_updated',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
@ -392,7 +392,7 @@
|
|||||||
'original_name': 'Owner',
|
'original_name': 'Owner',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'owner',
|
||||||
'unique_id': 'home-assistant.io_owner',
|
'unique_id': 'home-assistant.io_owner',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
@ -462,7 +462,7 @@
|
|||||||
'original_name': 'Registrant',
|
'original_name': 'Registrant',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'registrant',
|
||||||
'unique_id': 'home-assistant.io_registrant',
|
'unique_id': 'home-assistant.io_registrant',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
@ -532,7 +532,7 @@
|
|||||||
'original_name': 'Registrar',
|
'original_name': 'Registrar',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'registrar',
|
||||||
'unique_id': 'home-assistant.io_registrar',
|
'unique_id': 'home-assistant.io_registrar',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
@ -602,7 +602,7 @@
|
|||||||
'original_name': 'Reseller',
|
'original_name': 'Reseller',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'reseller',
|
||||||
'unique_id': 'home-assistant.io_reseller',
|
'unique_id': 'home-assistant.io_reseller',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
@ -672,7 +672,7 @@
|
|||||||
'original_name': 'Last updated',
|
'original_name': 'Last updated',
|
||||||
'platform': 'whois',
|
'platform': 'whois',
|
||||||
'supported_features': 0,
|
'supported_features': 0,
|
||||||
'translation_key': None,
|
'translation_key': 'last_updated',
|
||||||
'unique_id': 'home-assistant.io_last_updated',
|
'unique_id': 'home-assistant.io_last_updated',
|
||||||
'unit_of_measurement': None,
|
'unit_of_measurement': None,
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user