Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.notion.entity.NotionEntity Class Reference
Inheritance diagram for homeassistant.components.notion.entity.NotionEntity:
[legend]
Collaboration diagram for homeassistant.components.notion.entity.NotionEntity:
[legend]

Public Member Functions

None __init__ (self, NotionDataUpdateCoordinator coordinator, str listener_id, str sensor_id, int bridge_id, EntityDescription description)
 
bool available (self)
 
Listener listener (self)
 
- Public Member Functions inherited from homeassistant.helpers.update_coordinator.CoordinatorEntity
None __init__ (self, _DataUpdateCoordinatorT coordinator, Any context=None)
 
None async_update (self)
 
- Public Member Functions inherited from homeassistant.components.notion.coordinator.NotionDataUpdateCoordinator
None __init__ (self, HomeAssistant hass, *ConfigEntry entry, Client client)
 
- Public Member Functions inherited from homeassistant.helpers.update_coordinator.DataUpdateCoordinator
None __init__ (self, HomeAssistant hass, logging.Logger logger, *config_entries.ConfigEntry|None|UndefinedType config_entry=UNDEFINED, str name, timedelta|None update_interval=None, Callable[[], Awaitable[_DataT]]|None update_method=None, Callable[[], Awaitable[None]]|None setup_method=None, Debouncer[Coroutine[Any, Any, None]]|None request_refresh_debouncer=None, bool always_update=True)
 
Callable[[], None] async_add_listener (self, CALLBACK_TYPE update_callback, Any context=None)
 
None async_config_entry_first_refresh (self)
 
Generator[Any] async_contexts (self)
 
None async_refresh (self)
 
None async_register_shutdown (self)
 
None async_request_refresh (self)
 
None async_set_update_error (self, Exception err)
 
None async_set_updated_data (self, _DataT data)
 
None async_shutdown (self)
 
None async_update_listeners (self)
 
timedelta|None update_interval (self)
 
None update_interval (self, timedelta|None value)
 
- Public Member Functions inherited from homeassistant.components.notion.coordinator.NotionData
dict[str, Any] asdict (self)
 
None update_bridges (self, list[Bridge] bridges)
 
None update_listeners (self, list[Listener] listeners)
 
None update_sensors (self, list[Sensor] sensors)
 
None update_user_preferences (self, UserPreferences user_preferences)
 

Public Attributes

 entity_description
 
- Public Attributes inherited from homeassistant.helpers.update_coordinator.DataUpdateCoordinator
 always_update
 
 config_entry
 
 data
 
 hass
 
 last_exception
 
 last_update_success
 
 logger
 
 name
 
 setup_method
 
 update_interval
 
 update_method
 
- Public Attributes inherited from homeassistant.components.notion.coordinator.NotionData
 listeners
 
 sensors
 
 user_preferences
 

Private Member Functions

Bridge|None _async_get_bridge (self, int bridge_id)
 
None _async_update_bridge_id (self)
 
None _handle_coordinator_update (self)
 

Private Attributes

 _attr_device_info
 
 _attr_extra_state_attributes
 
 _attr_unique_id
 
 _bridge_id
 
 _listener_id
 
 _sensor_id
 

Static Private Attributes

bool _attr_has_entity_name = True
 

Additional Inherited Members

- Static Public Attributes inherited from homeassistant.components.notion.coordinator.NotionData
 default
 
 default_factory
 
 None
 

Detailed Description

Define a base Notion entity.

Definition at line 27 of file entity.py.

Constructor & Destructor Documentation

◆ __init__()

None homeassistant.components.notion.entity.NotionEntity.__init__ (   self,
NotionDataUpdateCoordinator  coordinator,
str  listener_id,
str  sensor_id,
int  bridge_id,
EntityDescription  description 
)
Initialize the entity.

Definition at line 32 of file entity.py.

Member Function Documentation

◆ _async_get_bridge()

Bridge | None homeassistant.components.notion.entity.NotionEntity._async_get_bridge (   self,
int  bridge_id 
)
private
Get a bridge by ID (if it exists).

Definition at line 77 of file entity.py.

◆ _async_update_bridge_id()

None homeassistant.components.notion.entity.NotionEntity._async_update_bridge_id (   self)
private
Update the entity's bridge ID if it has changed.

Sensors can move to other bridges based on signal strength, etc.

Definition at line 85 of file entity.py.

◆ _handle_coordinator_update()

None homeassistant.components.notion.entity.NotionEntity._handle_coordinator_update (   self)
private
Respond to a DataUpdateCoordinator update.

Definition at line 119 of file entity.py.

◆ available()

bool homeassistant.components.notion.entity.NotionEntity.available (   self)
Return True if entity is available.

Reimplemented from homeassistant.helpers.update_coordinator.CoordinatorEntity.

Definition at line 64 of file entity.py.

◆ listener()

Listener homeassistant.components.notion.entity.NotionEntity.listener (   self)
Return the listener related to this entity.

Definition at line 72 of file entity.py.

Member Data Documentation

◆ _attr_device_info

homeassistant.components.notion.entity.NotionEntity._attr_device_info
private

Definition at line 45 of file entity.py.

◆ _attr_extra_state_attributes

homeassistant.components.notion.entity.NotionEntity._attr_extra_state_attributes
private

Definition at line 56 of file entity.py.

◆ _attr_has_entity_name

bool homeassistant.components.notion.entity.NotionEntity._attr_has_entity_name = True
staticprivate

Definition at line 30 of file entity.py.

◆ _attr_unique_id

homeassistant.components.notion.entity.NotionEntity._attr_unique_id
private

Definition at line 57 of file entity.py.

◆ _bridge_id

homeassistant.components.notion.entity.NotionEntity._bridge_id
private

Definition at line 58 of file entity.py.

◆ _listener_id

homeassistant.components.notion.entity.NotionEntity._listener_id
private

Definition at line 59 of file entity.py.

◆ _sensor_id

homeassistant.components.notion.entity.NotionEntity._sensor_id
private

Definition at line 60 of file entity.py.

◆ entity_description

homeassistant.components.notion.entity.NotionEntity.entity_description

Definition at line 61 of file entity.py.


The documentation for this class was generated from the following file: