Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions custom_components/trmnl_sensor_push/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,7 @@ def create_entity_payload(state) -> dict:
"""Create the payload for a single entity."""
payload = {
"name": state.attributes.get('friendly_name', state.entity_id),
"value": state.state,
"device_class": state.attributes.get('device_class', None),
"unit_of_measurement": state.attributes.get('unit_of_measurement', None),
"icon": state.attributes.get('icon', None),
"friendly_name": state.attributes.get('friendly_name', state.entity_id),
"attributes": state.attributes
"value": state.state
}
_LOGGER.debug("TRMNL: Created payload for %s: %s", state.entity_id, payload)
return payload
Expand Down Expand Up @@ -135,4 +130,4 @@ async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
except Exception as err:
_LOGGER.error("TRMNL: Error unloading integration: %s", err)
return False
return True
return True