Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.mastodon.sensor Namespace Reference

Classes

class  MastodonSensorEntity
 
class  MastodonSensorEntityDescription
 

Functions

None async_setup_entry (HomeAssistant hass, MastodonConfigEntry entry, AddEntitiesCallback async_add_entities)
 

Variables

tuple ENTITY_DESCRIPTIONS
 

Detailed Description

Mastodon platform for sensor components.

Function Documentation

◆ async_setup_entry()

None homeassistant.components.mastodon.sensor.async_setup_entry ( HomeAssistant  hass,
MastodonConfigEntry  entry,
AddEntitiesCallback  async_add_entities 
)
Set up the sensor platform for entity.

Definition at line 56 of file sensor.py.

Variable Documentation

◆ ENTITY_DESCRIPTIONS

tuple homeassistant.components.mastodon.sensor.ENTITY_DESCRIPTIONS
Initial value:
1 = (
2  MastodonSensorEntityDescription(
3  key="followers",
4  translation_key="followers",
5  state_class=SensorStateClass.TOTAL,
6  value_fn=lambda data: data.get(ACCOUNT_FOLLOWERS_COUNT),
7  ),
8  MastodonSensorEntityDescription(
9  key="following",
10  translation_key="following",
11  state_class=SensorStateClass.TOTAL,
12  value_fn=lambda data: data.get(ACCOUNT_FOLLOWING_COUNT),
13  ),
14  MastodonSensorEntityDescription(
15  key="posts",
16  translation_key="posts",
17  state_class=SensorStateClass.TOTAL,
18  value_fn=lambda data: data.get(ACCOUNT_STATUSES_COUNT),
19  ),
20 )

Definition at line 34 of file sensor.py.