Skip to content

Commit

Permalink
Better extra state
Browse files Browse the repository at this point in the history
  • Loading branch information
krasnoukhov committed Oct 21, 2023
1 parent 9bc3ace commit 0e5a746
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion custom_components/nova_poshta/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
"iot_class": "cloud_polling",
"issue_tracker": "https://github.com/krasnoukhov/homeassistant-nova-poshta/issues",
"requirements": ["transliterate==1.10.2", "stringcase>=1.2.0", "git+https://github.com/krasnoukhov/novaposhta-python-client.git@errors#novaposhta-python-client==0.1.2"],
"version": "1.0.0-beta.2"
"version": "1.0.0-beta.3"
}
10 changes: 4 additions & 6 deletions custom_components/nova_poshta/sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,10 @@ def native_value(self) -> StateType:
def extra_state_attributes(self) -> dict[str, str] | None:
"""Return the state attributes."""
return {
"parcels": "\n\n".join(
map(
lambda x: f"{x['CargoDescription']}\n{x['CounterpartySenderDescription']}",
self._parcels,
)
)
"parcels": list(map(
lambda x: f"{x['CargoDescription']} - {x['CounterpartySenderDescription']}",
self._parcels,
))
}

@property
Expand Down

0 comments on commit 0e5a746

Please sign in to comment.