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

Classes

class  FitbitBatteryLevelSensor
 
class  FitbitBatterySensor
 
class  FitbitSensor
 
class  FitbitSensorEntityDescription
 

Functions

int|str _body_value_fn (dict[str, Any] result)
 
DeviceInfo _build_device_info (ConfigEntry config_entry, FitbitSensorEntityDescription entity_description)
 
str _clock_format_12h (dict[str, Any] result)
 
str _default_value_fn (dict[str, Any] result)
 
UnitOfLength _distance_unit (FitbitUnitSystem unit_system)
 
int|str _distance_value_fn (dict[str, Any] result)
 
UnitOfLength _elevation_unit (FitbitUnitSystem unit_system)
 
Callable[[dict[str, Any]], int|None] _int_value_or_none (str field)
 
UnitOfVolume _water_unit (FitbitUnitSystem unit_system)
 
UnitOfMass _weight_unit (FitbitUnitSystem unit_system)
 
None async_setup_entry (HomeAssistant hass, ConfigEntry entry, AddEntitiesCallback async_add_entities)
 

Variables

 Final
 
 FITBIT_RESOURCE_BATTERY
 
 FITBIT_RESOURCE_BATTERY_LEVEL
 
string FITBIT_TRACKER_SUBSTRING = "/tracker/"
 
 minutes
 
 SLEEP_START_TIME
 
 SLEEP_START_TIME_12HR
 

Detailed Description

Support for the Fitbit API.

Function Documentation

◆ _body_value_fn()

int | str homeassistant.components.fitbit.sensor._body_value_fn ( dict[str, Any]  result)
private
Format function for body values.

Definition at line 57 of file sensor.py.

◆ _build_device_info()

DeviceInfo homeassistant.components.fitbit.sensor._build_device_info ( ConfigEntry  config_entry,
FitbitSensorEntityDescription   entity_description 
)
private
Build device info for sensor entities info across devices.

Definition at line 133 of file sensor.py.

◆ _clock_format_12h()

str homeassistant.components.fitbit.sensor._clock_format_12h ( dict[str, Any]  result)
private

Definition at line 62 of file sensor.py.

◆ _default_value_fn()

str homeassistant.components.fitbit.sensor._default_value_fn ( dict[str, Any]  result)
private
Parse a Fitbit timeseries API responses.

Definition at line 47 of file sensor.py.

◆ _distance_unit()

UnitOfLength homeassistant.components.fitbit.sensor._distance_unit ( FitbitUnitSystem  unit_system)
private
Determine the distance unit.

Definition at line 86 of file sensor.py.

◆ _distance_value_fn()

int | str homeassistant.components.fitbit.sensor._distance_value_fn ( dict[str, Any]  result)
private
Format function for distance values.

Definition at line 52 of file sensor.py.

◆ _elevation_unit()

UnitOfLength homeassistant.components.fitbit.sensor._elevation_unit ( FitbitUnitSystem  unit_system)
private
Determine the elevation unit.

Definition at line 93 of file sensor.py.

◆ _int_value_or_none()

Callable[[dict[str, Any]], int | None] homeassistant.components.fitbit.sensor._int_value_or_none ( str  field)
private
Value function that will parse the specified field if present.

Definition at line 107 of file sensor.py.

◆ _water_unit()

UnitOfVolume homeassistant.components.fitbit.sensor._water_unit ( FitbitUnitSystem  unit_system)
private
Determine the water unit.

Definition at line 100 of file sensor.py.

◆ _weight_unit()

UnitOfMass homeassistant.components.fitbit.sensor._weight_unit ( FitbitUnitSystem  unit_system)
private
Determine the weight unit.

Definition at line 77 of file sensor.py.

◆ async_setup_entry()

None homeassistant.components.fitbit.sensor.async_setup_entry ( HomeAssistant  hass,
ConfigEntry  entry,
AddEntitiesCallback  async_add_entities 
)
Set up the Fitbit sensor platform.

Definition at line 525 of file sensor.py.

Variable Documentation

◆ Final

homeassistant.components.fitbit.sensor.Final

Definition at line 38 of file sensor.py.

◆ FITBIT_RESOURCE_BATTERY

homeassistant.components.fitbit.sensor.FITBIT_RESOURCE_BATTERY
Initial value:
1 = FitbitSensorEntityDescription(
2  key="devices/battery",
3  translation_key="battery",
4  icon="mdi:battery",
5  scope=FitbitScope.DEVICE,
6  entity_category=EntityCategory.DIAGNOSTIC,
7  has_entity_name=True,
8 )

Definition at line 506 of file sensor.py.

◆ FITBIT_RESOURCE_BATTERY_LEVEL

homeassistant.components.fitbit.sensor.FITBIT_RESOURCE_BATTERY_LEVEL
Initial value:
1 = FitbitSensorEntityDescription(
2  key="devices/battery_level",
3  translation_key="battery_level",
4  scope=FitbitScope.DEVICE,
5  entity_category=EntityCategory.DIAGNOSTIC,
6  has_entity_name=True,
7  device_class=SensorDeviceClass.BATTERY,
8  native_unit_of_measurement=PERCENTAGE,
9 )

Definition at line 514 of file sensor.py.

◆ FITBIT_TRACKER_SUBSTRING

string homeassistant.components.fitbit.sensor.FITBIT_TRACKER_SUBSTRING = "/tracker/"

Definition at line 44 of file sensor.py.

◆ minutes

homeassistant.components.fitbit.sensor.minutes

Definition at line 42 of file sensor.py.

◆ SLEEP_START_TIME

homeassistant.components.fitbit.sensor.SLEEP_START_TIME
Initial value:
1 = FitbitSensorEntityDescription(
2  key="sleep/startTime",
3  translation_key="sleep_start_time",
4  icon="mdi:clock",
5  scope=FitbitScope.SLEEP,
6  entity_category=EntityCategory.DIAGNOSTIC,
7 )

Definition at line 490 of file sensor.py.

◆ SLEEP_START_TIME_12HR

homeassistant.components.fitbit.sensor.SLEEP_START_TIME_12HR
Initial value:
1 = FitbitSensorEntityDescription(
2  key="sleep/startTime",
3  translation_key="sleep_start_time",
4  icon="mdi:clock",
5  value_fn=_clock_format_12h,
6  scope=FitbitScope.SLEEP,
7  entity_category=EntityCategory.DIAGNOSTIC,
8 )

Definition at line 497 of file sensor.py.