mirror of
https://github.com/home-assistant/core.git
synced 2026-08-24 10:13:52 -05:00
Use EntityStateAttribute enum in CityBikes (#176396)
This commit is contained in:
@@ -17,13 +17,12 @@ from homeassistant.components.sensor import (
|
||||
)
|
||||
from homeassistant.const import (
|
||||
APPLICATION_NAME,
|
||||
ATTR_LATITUDE,
|
||||
ATTR_LONGITUDE,
|
||||
CONF_LATITUDE,
|
||||
CONF_LONGITUDE,
|
||||
CONF_NAME,
|
||||
CONF_RADIUS,
|
||||
EVENT_HOMEASSISTANT_CLOSE,
|
||||
EntityStateAttribute,
|
||||
UnitOfLength,
|
||||
__version__,
|
||||
)
|
||||
@@ -235,8 +234,8 @@ class CityBikesStation(SensorEntity):
|
||||
self._attr_native_value = station.free_bikes
|
||||
self._attr_extra_state_attributes = {
|
||||
ATTR_UID: station.extra.get(ATTR_UID),
|
||||
ATTR_LATITUDE: station.latitude,
|
||||
ATTR_LONGITUDE: station.longitude,
|
||||
EntityStateAttribute.LATITUDE: station.latitude,
|
||||
EntityStateAttribute.LONGITUDE: station.longitude,
|
||||
ATTR_EMPTY_SLOTS: station.empty_slots,
|
||||
ATTR_FREE_EBIKES: station.extra.get(EXTRA_EBIKES),
|
||||
ATTR_TIMESTAMP: station.timestamp,
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
'free_ebikes': 2,
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Station 1',
|
||||
<EntityStateAttribute.ICON: 'icon'>: 'mdi:bike',
|
||||
'latitude': 40.0,
|
||||
'longitude': -73.0,
|
||||
<EntityStateAttribute.LATITUDE: 'latitude'>: 40.0,
|
||||
<EntityStateAttribute.LONGITUDE: 'longitude'>: -73.0,
|
||||
'timestamp': '2026-03-22T00:00:00Z',
|
||||
'uid': 'uid-1',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'bikes',
|
||||
@@ -29,8 +29,8 @@
|
||||
'free_ebikes': None,
|
||||
<EntityStateAttribute.FRIENDLY_NAME: 'friendly_name'>: 'Station 1',
|
||||
<EntityStateAttribute.ICON: 'icon'>: 'mdi:bike',
|
||||
'latitude': 40.0,
|
||||
'longitude': -73.0,
|
||||
<EntityStateAttribute.LATITUDE: 'latitude'>: 40.0,
|
||||
<EntityStateAttribute.LONGITUDE: 'longitude'>: -73.0,
|
||||
'timestamp': '2026-03-22T00:00:00Z',
|
||||
'uid': 'uid-1',
|
||||
<EntityStateAttribute.UNIT_OF_MEASUREMENT: 'unit_of_measurement'>: 'bikes',
|
||||
|
||||
Reference in New Issue
Block a user