@@ -50,7 +50,7 @@ async def async_setup_entry(
5050 async_add_entities : AddEntitiesCallback ,
5151) -> None :
5252 """Set up PocketSmith sensors from a config entry."""
53- coordinator : PocketSmithCoordinator = hass . data [ DOMAIN ][ entry .entry_id ]
53+ coordinator : PocketSmithCoordinator = entry .runtime_data
5454
5555 sensors = [
5656 PocketSmithSensor (coordinator , account )
@@ -70,6 +70,8 @@ async def async_setup_entry(
7070class PocketSmithSensor (CoordinatorEntity , SensorEntity ):
7171 """Representation of a PocketSmith account balance sensor."""
7272
73+ _attr_has_entity_name = True
74+
7375 def __init__ (self , coordinator : PocketSmithCoordinator , account : dict ) -> None :
7476 """Initialise the sensor."""
7577 super ().__init__ (coordinator )
@@ -130,6 +132,8 @@ def extra_state_attributes(self) -> dict:
130132class PocketSmithUncategorisedTransactions (CoordinatorEntity , SensorEntity ):
131133 """Sensor reporting the count of uncategorised transactions."""
132134
135+ _attr_has_entity_name = True
136+
133137 def __init__ (self , coordinator : PocketSmithCoordinator ) -> None :
134138 """Initialise the sensor."""
135139 super ().__init__ (coordinator )
@@ -168,6 +172,8 @@ def icon(self) -> str:
168172class PocketSmithCategoriesSensor (CoordinatorEntity , SensorEntity ):
169173 """Sensor reporting the total number of PocketSmith categories."""
170174
175+ _attr_has_entity_name = True
176+
171177 def __init__ (self , coordinator : PocketSmithCoordinator ) -> None :
172178 """Initialise the sensor."""
173179 super ().__init__ (coordinator )
@@ -210,6 +216,8 @@ def extra_state_attributes(self) -> dict:
210216class PocketSmithCategorySensor (CoordinatorEntity , SensorEntity ):
211217 """Sensor representing a single enriched PocketSmith category."""
212218
219+ _attr_has_entity_name = True
220+
213221 def __init__ (self , coordinator : PocketSmithCoordinator , enriched_category : dict ) -> None :
214222 """Initialise the sensor."""
215223 super ().__init__ (coordinator )
@@ -280,6 +288,8 @@ def extra_state_attributes(self) -> dict:
280288class PocketSmithNetWorthSensor (CoordinatorEntity , SensorEntity ):
281289 """Sensor reporting the total net worth across all accounts."""
282290
291+ _attr_has_entity_name = True
292+
283293 def __init__ (self , coordinator : PocketSmithCoordinator ) -> None :
284294 """Initialise the sensor."""
285295 super ().__init__ (coordinator )
@@ -326,6 +336,8 @@ def icon(self) -> str:
326336class PocketSmithUserSensor (CoordinatorEntity , SensorEntity ):
327337 """Sensor reporting PocketSmith user profile information."""
328338
339+ _attr_has_entity_name = True
340+
329341 def __init__ (self , coordinator : PocketSmithCoordinator ) -> None :
330342 """Initialise the sensor."""
331343 super ().__init__ (coordinator )
0 commit comments