Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.plant.Plant Class Reference
Inheritance diagram for homeassistant.components.plant.Plant:
[legend]
Collaboration diagram for homeassistant.components.plant.Plant:
[legend]

Public Member Functions

def __init__ (self, name, config)
 
def async_added_to_hass (self)
 
def extra_state_attributes (self)
 
def name (self)
 
def state (self)
 
None state_changed (self, str entity_id, State|None new_state)
 
- Public Member Functions inherited from homeassistant.helpers.entity.Entity
None __init_subclass__ (cls, **Any kwargs)
 
str __repr__ (self)
 
None add_to_platform_abort (self)
 
None add_to_platform_finish (self)
 
None add_to_platform_start (self, HomeAssistant hass, EntityPlatform platform, asyncio.Semaphore|None parallel_updates)
 
bool assumed_state (self)
 
None async_device_update (self, bool warning=True)
 
None async_internal_added_to_hass (self)
 
None async_internal_will_remove_from_hass (self)
 
None async_on_remove (self, CALLBACK_TYPE func)
 
None async_registry_entry_updated (self)
 
None async_remove (self, *bool force_remove=False)
 
None async_removed_from_registry (self)
 
None async_schedule_update_ha_state (self, bool force_refresh=False)
 
None async_set_context (self, Context context)
 
None async_update_ha_state (self, bool force_refresh=False)
 
None async_will_remove_from_hass (self)
 
None async_write_ha_state (self)
 
str|None attribution (self)
 
bool available (self)
 
dict[str, Any]|None capability_attributes (self)
 
str|None device_class (self)
 
DeviceInfo|None device_info (self)
 
bool enabled (self)
 
EntityCategory|None entity_category (self)
 
str|None entity_picture (self)
 
bool entity_registry_enabled_default (self)
 
bool entity_registry_visible_default (self)
 
bool force_update (self)
 
HassJobType get_hassjob_type (self, str function_name)
 
er.EntityOptionsType|None get_initial_entity_options (self)
 
bool has_entity_name (self)
 
str|None icon (self)
 
None schedule_update_ha_state (self, bool force_refresh=False)
 
bool should_poll (self)
 
dict[str, Any]|None state_attributes (self)
 
str|None suggested_object_id (self)
 
int|None supported_features (self)
 
str|None translation_key (self)
 
Mapping[str, strtranslation_placeholders (self)
 
str|None unique_id (self)
 
str|None unit_of_measurement (self)
 
bool use_device_name (self)
 
- Public Member Functions inherited from homeassistant.helpers.entity.CachedProperties
None __init__ (cls, str name, tuple[type,...] bases, dict[Any, Any] namespace, **Any kwargs)
 
Any __new__ (mcs, str name, tuple[type,...] bases, dict[Any, Any] namespace, set[str]|None cached_properties=None, **Any kwargs)
 

Static Public Attributes

dictionary READINGS
 
- Static Public Attributes inherited from homeassistant.helpers.entity.Entity
 bool
 
 EntityPlatform
 
 HomeAssistant
 
 None
 
 StateInfo
 
 StateType
 
 str
 

Private Member Functions

def _check_max (self, sensor_name, value, params)
 
def _check_min (self, sensor_name, value, params)
 
def _load_history_from_db (self)
 
None _state_changed_event (self, Event[EventStateChangedData] event)
 
def _update_state (self)
 

Private Attributes

 _battery
 
 _brightness
 
 _brightness_history
 
 _conductivity
 
 _conf_check_days
 
 _config
 
 _moisture
 
 _name
 
 _problems
 
 _readingmap
 
 _sensormap
 
 _state
 
 _temperature
 
 _unit_of_measurement
 

Static Private Attributes

bool _attr_should_poll = False
 

Additional Inherited Members

- Public Attributes inherited from homeassistant.helpers.entity.Entity
 device_entry
 
 entity_id
 
 hass
 
 parallel_updates
 
 platform
 
 registry_entry
 

Detailed Description

Plant monitors the well-being of a plant.

It also checks the measurements against
configurable min and max values.

DEVELOPMENT OF THE PLANT INTEGRATION IS FROZEN
PENDING A DESIGN EVALUATION.

Definition at line 130 of file __init__.py.

Constructor & Destructor Documentation

◆ __init__()

def homeassistant.components.plant.Plant.__init__ (   self,
  name,
  config 
)
Initialize the Plant component.

Definition at line 169 of file __init__.py.

Member Function Documentation

◆ _check_max()

def homeassistant.components.plant.Plant._check_max (   self,
  sensor_name,
  value,
  params 
)
private
If configured, check the value against the defined maximum value.

Definition at line 280 of file __init__.py.

◆ _check_min()

def homeassistant.components.plant.Plant._check_min (   self,
  sensor_name,
  value,
  params 
)
private
If configured, check the value against the defined minimum value.

Definition at line 272 of file __init__.py.

◆ _load_history_from_db()

def homeassistant.components.plant.Plant._load_history_from_db (   self)
private
Load the history of the brightness values from the database.

This only needs to be done once during startup.

Definition at line 305 of file __init__.py.

◆ _state_changed_event()

None homeassistant.components.plant.Plant._state_changed_event (   self,
Event[EventStateChangedData event 
)
private
Sensor state change event.

Definition at line 193 of file __init__.py.

◆ _update_state()

def homeassistant.components.plant.Plant._update_state (   self)
private
Update the state of the class based sensor data.

Definition at line 242 of file __init__.py.

◆ async_added_to_hass()

def homeassistant.components.plant.Plant.async_added_to_hass (   self)
After being added to hass, load from history.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 288 of file __init__.py.

◆ extra_state_attributes()

def homeassistant.components.plant.Plant.extra_state_attributes (   self)
Return the attributes of the entity.

Provide the individual measurements from the
sensor in the attributes of the device.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 348 of file __init__.py.

◆ name()

def homeassistant.components.plant.Plant.name (   self)
Return the name of the sensor.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 338 of file __init__.py.

◆ state()

def homeassistant.components.plant.Plant.state (   self)
Return the state of the entity.

Reimplemented from homeassistant.helpers.entity.Entity.

Definition at line 343 of file __init__.py.

◆ state_changed()

None homeassistant.components.plant.Plant.state_changed (   self,
str  entity_id,
State | None  new_state 
)
Update the sensor status.

Definition at line 198 of file __init__.py.

Member Data Documentation

◆ _attr_should_poll

bool homeassistant.components.plant.Plant._attr_should_poll = False
staticprivate

Definition at line 140 of file __init__.py.

◆ _battery

homeassistant.components.plant.Plant._battery
private

Definition at line 180 of file __init__.py.

◆ _brightness

homeassistant.components.plant.Plant._brightness
private

Definition at line 184 of file __init__.py.

◆ _brightness_history

homeassistant.components.plant.Plant._brightness_history
private

Definition at line 190 of file __init__.py.

◆ _conductivity

homeassistant.components.plant.Plant._conductivity
private

Definition at line 182 of file __init__.py.

◆ _conf_check_days

homeassistant.components.plant.Plant._conf_check_days
private

Definition at line 187 of file __init__.py.

◆ _config

homeassistant.components.plant.Plant._config
private

Definition at line 171 of file __init__.py.

◆ _moisture

homeassistant.components.plant.Plant._moisture
private

Definition at line 181 of file __init__.py.

◆ _name

homeassistant.components.plant.Plant._name
private

Definition at line 179 of file __init__.py.

◆ _problems

homeassistant.components.plant.Plant._problems
private

Definition at line 185 of file __init__.py.

◆ _readingmap

homeassistant.components.plant.Plant._readingmap
private

Definition at line 173 of file __init__.py.

◆ _sensormap

homeassistant.components.plant.Plant._sensormap
private

Definition at line 172 of file __init__.py.

◆ _state

homeassistant.components.plant.Plant._state
private

Definition at line 178 of file __init__.py.

◆ _temperature

homeassistant.components.plant.Plant._temperature
private

Definition at line 183 of file __init__.py.

◆ _unit_of_measurement

homeassistant.components.plant.Plant._unit_of_measurement
private

Definition at line 174 of file __init__.py.

◆ READINGS

dictionary homeassistant.components.plant.Plant.READINGS
static
Initial value:
= {
READING_BATTERY: {
ATTR_UNIT_OF_MEASUREMENT: PERCENTAGE,
"min": CONF_MIN_BATTERY_LEVEL,
},
READING_TEMPERATURE: {
ATTR_UNIT_OF_MEASUREMENT: UnitOfTemperature.CELSIUS,
"min": CONF_MIN_TEMPERATURE,
"max": CONF_MAX_TEMPERATURE,
},
READING_MOISTURE: {
ATTR_UNIT_OF_MEASUREMENT: PERCENTAGE,
"min": CONF_MIN_MOISTURE,
"max": CONF_MAX_MOISTURE,
},
READING_CONDUCTIVITY: {
ATTR_UNIT_OF_MEASUREMENT: UnitOfConductivity.MICROSIEMENS_PER_CM,
"min": CONF_MIN_CONDUCTIVITY,
"max": CONF_MAX_CONDUCTIVITY,
},
READING_BRIGHTNESS: {
ATTR_UNIT_OF_MEASUREMENT: LIGHT_LUX,
"min": CONF_MIN_BRIGHTNESS,
"max": CONF_MAX_BRIGHTNESS,
},
}

Definition at line 142 of file __init__.py.


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