class platypush.plugins.sensor.bme280.SensorBme280Plugin(*_, **__)[source]#

Bases: SensorPlugin

Plugin to interact with a BME280 environment sensor for temperature, humidity and pressure measurements over I2C interface


  • pimoroni-bme280 (pip install pimoroni-bme280)


__init__(port: int = 1, **kwargs)[source]#

port – I2C port. 0 = /dev/i2c-0 (port I2C0), 1 = /dev/i2c-1 (port I2C1)

get_measurement(*_, **__)[source]#

dict. Example:

output = {
    "temperature": 21.0,   # Celsius
    "pressure": 101555.08, # Pascals
    "humidity": 23.543,    # percentage
    "altitude": 15.703     # meters
transform_entities(entities: Dict[str, float | int]) List[Device][source]#

This method takes a list of entities in any (plugin-specific) format and converts them into a standardized collection of Entity objects. Since this method is called by publish_entities() before entity updates are published, you may usually want to extend it to pre-process the entities managed by your extension into the standard format before they are stored and published to all the consumers.

class platypush.plugins.sensor.bme280.SensorEntityMapping(name: str, unit: str, entity_type: Type[NumericSensor])[source]#

Bases: object

Maps the dict-like data returned by the plugin to corresponding sensor entities.

__init__(name: str, unit: str, entity_type: Type[NumericSensor]) None#
property id#

The standardized external ID for the entity.