Skip to content

Commit

Permalink
Add support for the number of images (#234)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck authored Jun 29, 2023
1 parent 2c6ce07 commit cc446fc
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ of the box.
- Number of `device_tracker` entities.
- Number of `fan` entities.
- Number of `humidifier` entities.
- Number of `image` entities.
- Number of `input_boolean` entities.
- Number of `input_button` entities.
- Number of `input_number` entities.
Expand Down
10 changes: 10 additions & 0 deletions custom_components/spook/ectoplasms/homeassistant/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,16 @@ class HomeAssistantSpookSensorEntityDescription(
update_events={EVENT_COMPONENT_LOADED, er.EVENT_ENTITY_REGISTRY_UPDATED},
value_fn=lambda hass: len(hass.states.async_entity_ids(input_text.DOMAIN)),
),
HomeAssistantSpookSensorEntityDescription(
key=Platform.IMAGE,
translation_key="homeassistant_image",
entity_id="sensor.images",
icon="mdi:image",
entity_category=EntityCategory.DIAGNOSTIC,
state_class=SensorStateClass.TOTAL,
update_events={EVENT_COMPONENT_LOADED, er.EVENT_ENTITY_REGISTRY_UPDATED},
value_fn=lambda hass: len(hass.states.async_entity_ids(Platform.IMAGE)),
),
HomeAssistantSpookSensorEntityDescription(
key=Platform.LIGHT,
translation_key="homeassistant_light",
Expand Down
3 changes: 3 additions & 0 deletions custom_components/spook/translations/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
}
},
"sensor": {
"homeassistant_image": {
"name": "Bilder"
},
"homeassistant_air_quality": {
"name": "Luftqualität"
},
Expand Down
3 changes: 3 additions & 0 deletions custom_components/spook/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@
"homeassistant_humidifier": {
"name": "Humidifiers"
},
"homeassistant_image": {
"name": "Images"
},
"homeassistant_input_boolean": {
"name": "Input booleans"
},
Expand Down
3 changes: 3 additions & 0 deletions custom_components/spook/translations/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
}
},
"sensor": {
"homeassistant_image": {
"name": "Imágenes"
},
"homeassistant_air_quality": {
"name": "Calidad del aire"
},
Expand Down
3 changes: 3 additions & 0 deletions custom_components/spook/translations/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
}
},
"sensor": {
"homeassistant_image": {
"name": "Afbeeldingen"
},
"homeassistant_air_quality": {
"name": "Luchtkwaliteit"
},
Expand Down

0 comments on commit cc446fc

Please sign in to comment.