Skip to content

Commit

Permalink
add chef-hat icon to sensors & more attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
FaserF committed Aug 29, 2024
1 parent d34f775 commit 45ff9b5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion custom_components/chefkoch_ha/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ def __init__(self, coordinator, sensor_type):
super().__init__(coordinator)
self._attr_name = SENSOR_TYPES[sensor_type]
self._sensor_type = sensor_type
self._attr_icon = "mdi:chef-hat"

@property
def state(self):
Expand All @@ -38,8 +39,11 @@ def extra_state_attributes(self):
data = self.coordinator.data.get(self._sensor_type, {})
_LOGGER.debug("Sensor state attributes: %s", data)
return {
"url": data.get("url", ""),
"image_url": data.get("image_url", ""),
"totalTime": data.get("totalTime", ""),
"ingredients": data.get("ingredients", ""),
"calories": data.get("calories", ""),
"difficulty": data.get("difficulty", ""),
"ingredients": data.get("ingredients", []),
}
}

0 comments on commit 45ff9b5

Please sign in to comment.