Add icon translations to Github (#111614)
* Add icon translations to Github * Fix
This commit is contained in:
parent
510e7ccf76
commit
23353812a9
3 changed files with 64 additions and 6 deletions
42
homeassistant/components/github/icons.json
Normal file
42
homeassistant/components/github/icons.json
Normal file
|
@ -0,0 +1,42 @@
|
|||
{
|
||||
"entity": {
|
||||
"sensor": {
|
||||
"discussions_count": {
|
||||
"default": "mdi:forum"
|
||||
},
|
||||
"stargazers_count": {
|
||||
"default": "mdi:star"
|
||||
},
|
||||
"subscribers_count": {
|
||||
"default": "mdi:glasses"
|
||||
},
|
||||
"forks_count": {
|
||||
"default": "mdi:source-fork"
|
||||
},
|
||||
"issues_count": {
|
||||
"default": "mdi:github"
|
||||
},
|
||||
"pulls_count": {
|
||||
"default": "mdi:source-pull"
|
||||
},
|
||||
"latest_commit": {
|
||||
"default": "mdi:source-commit"
|
||||
},
|
||||
"latest_discussion": {
|
||||
"default": "mdi:forum"
|
||||
},
|
||||
"latest_release": {
|
||||
"default": "mdi:github"
|
||||
},
|
||||
"latest_issue": {
|
||||
"default": "mdi:github"
|
||||
},
|
||||
"latest_pull_request": {
|
||||
"default": "mdi:source-pull"
|
||||
},
|
||||
"latest_tag": {
|
||||
"default": "mdi:tag"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -28,7 +28,7 @@ class GitHubSensorEntityDescription(SensorEntityDescription):
|
|||
"""Describes GitHub issue sensor entity."""
|
||||
|
||||
value_fn: Callable[[dict[str, Any]], StateType]
|
||||
icon: str = "mdi:github"
|
||||
|
||||
attr_fn: Callable[[dict[str, Any]], Mapping[str, Any] | None] = lambda data: None
|
||||
avabl_fn: Callable[[dict[str, Any]], bool] = lambda data: True
|
||||
|
||||
|
@ -45,7 +45,6 @@ SENSOR_DESCRIPTIONS: tuple[GitHubSensorEntityDescription, ...] = (
|
|||
GitHubSensorEntityDescription(
|
||||
key="stargazers_count",
|
||||
translation_key="stargazers_count",
|
||||
icon="mdi:star",
|
||||
native_unit_of_measurement="Stars",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -54,7 +53,6 @@ SENSOR_DESCRIPTIONS: tuple[GitHubSensorEntityDescription, ...] = (
|
|||
GitHubSensorEntityDescription(
|
||||
key="subscribers_count",
|
||||
translation_key="subscribers_count",
|
||||
icon="mdi:glasses",
|
||||
native_unit_of_measurement="Watchers",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
@ -63,7 +61,6 @@ SENSOR_DESCRIPTIONS: tuple[GitHubSensorEntityDescription, ...] = (
|
|||
GitHubSensorEntityDescription(
|
||||
key="forks_count",
|
||||
translation_key="forks_count",
|
||||
icon="mdi:source-fork",
|
||||
native_unit_of_measurement="Forks",
|
||||
entity_category=EntityCategory.DIAGNOSTIC,
|
||||
state_class=SensorStateClass.MEASUREMENT,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue