caspia.meadow.services.sensors package

Submodules

caspia.meadow.services.sensors.carbondioxide module

class caspia.meadow.services.sensors.carbondioxide.CarbonDioxideSensorBase(name, include=())[source]

Bases: caspia.meadow.services.base.ServiceBase

Represents a Carbon Dioxide (CO2) sensor.

Initialize new service.

Parameters
  • name – Name of the service (or just its path)

  • include – What optional characteristics to include. Tuple of their names.

property all_observables
auto_discovery = True
characteristic_cached_read(characteristic)

This method implements return value of characteristic’s value property.

characteristic_cached_write(characteristic, value)

This method implements writing to characteristic’s value property.

async characteristic_read(characteristic, **kwargs)

Read value of the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

Returns

Tuple (value, extra).

characteristic_subscribe(characteristic, on_value, on_error=None)
async characteristic_write(characteristic, value, **kwargs)

Write a value to the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

characteristics = {'$metadata': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:$metadata>, 'level': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:level>}
static get_subclass(stype, mixin=None)
level
load_definition(spec)

Update characteristics of this instance based on serialized specs.

Parameters

spec – Dict most likely going to be coming from meadow - from some gateway informing us about its services and their characteristics.

metadata
on(name, *args, **kwargs)
optional = {}
serialize()

Return serialized version (most likely dict) if possible or None.

type = 'carbon-dioxide-sensor'

caspia.meadow.services.sensors.humidity module

class caspia.meadow.services.sensors.humidity.HumiditySensorBase(name, include=())[source]

Bases: caspia.meadow.services.base.ServiceBase

Represents a relative humidity sensor.

Initialize new service.

Parameters
  • name – Name of the service (or just its path)

  • include – What optional characteristics to include. Tuple of their names.

property all_observables
auto_discovery = True
characteristic_cached_read(characteristic)

This method implements return value of characteristic’s value property.

characteristic_cached_write(characteristic, value)

This method implements writing to characteristic’s value property.

async characteristic_read(characteristic, **kwargs)

Read value of the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

Returns

Tuple (value, extra).

characteristic_subscribe(characteristic, on_value, on_error=None)
async characteristic_write(characteristic, value, **kwargs)

Write a value to the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

characteristics = {'$metadata': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:$metadata>, 'humidity': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:humidity>}
static get_subclass(stype, mixin=None)
humidity
load_definition(spec)

Update characteristics of this instance based on serialized specs.

Parameters

spec – Dict most likely going to be coming from meadow - from some gateway informing us about its services and their characteristics.

metadata
on(name, *args, **kwargs)
optional = {}
serialize()

Return serialized version (most likely dict) if possible or None.

type = 'humidity-sensor'

caspia.meadow.services.sensors.light module

class caspia.meadow.services.sensors.light.LightSensorBase(name, include=())[source]

Bases: caspia.meadow.services.base.ServiceBase

Represents a light sensor.

Initialize new service.

Parameters
  • name – Name of the service (or just its path)

  • include – What optional characteristics to include. Tuple of their names.

property all_observables
auto_discovery = True
characteristic_cached_read(characteristic)

This method implements return value of characteristic’s value property.

characteristic_cached_write(characteristic, value)

This method implements writing to characteristic’s value property.

async characteristic_read(characteristic, **kwargs)

Read value of the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

Returns

Tuple (value, extra).

characteristic_subscribe(characteristic, on_value, on_error=None)
async characteristic_write(characteristic, value, **kwargs)

Write a value to the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

characteristics = {'$metadata': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:$metadata>, 'light': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:light>}
static get_subclass(stype, mixin=None)
light
load_definition(spec)

Update characteristics of this instance based on serialized specs.

Parameters

spec – Dict most likely going to be coming from meadow - from some gateway informing us about its services and their characteristics.

metadata
on(name, *args, **kwargs)
optional = {}
serialize()

Return serialized version (most likely dict) if possible or None.

type = 'light-sensor'

caspia.meadow.services.sensors.motion module

class caspia.meadow.services.sensors.motion.MotionSensorBase(name, include=())[source]

Bases: caspia.meadow.services.base.ServiceBase

Represents a motion sensor.

Initialize new service.

Parameters
  • name – Name of the service (or just its path)

  • include – What optional characteristics to include. Tuple of their names.

property all_observables
auto_discovery = True
characteristic_cached_read(characteristic)

This method implements return value of characteristic’s value property.

characteristic_cached_write(characteristic, value)

This method implements writing to characteristic’s value property.

async characteristic_read(characteristic, **kwargs)

Read value of the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

Returns

Tuple (value, extra).

characteristic_subscribe(characteristic, on_value, on_error=None)
async characteristic_write(characteristic, value, **kwargs)

Write a value to the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

characteristics = {'$metadata': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:$metadata>, 'motion_detected': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:motion_detected>}
static get_subclass(stype, mixin=None)
load_definition(spec)

Update characteristics of this instance based on serialized specs.

Parameters

spec – Dict most likely going to be coming from meadow - from some gateway informing us about its services and their characteristics.

metadata
motion_detected
on(name, *args, **kwargs)
optional = {}
serialize()

Return serialized version (most likely dict) if possible or None.

type = 'motion-sensor'

caspia.meadow.services.sensors.noise module

class caspia.meadow.services.sensors.noise.NoiseSensorBase(name, include=())[source]

Bases: caspia.meadow.services.base.ServiceBase

Represents a noise sensor.

Initialize new service.

Parameters
  • name – Name of the service (or just its path)

  • include – What optional characteristics to include. Tuple of their names.

property all_observables
auto_discovery = True
characteristic_cached_read(characteristic)

This method implements return value of characteristic’s value property.

characteristic_cached_write(characteristic, value)

This method implements writing to characteristic’s value property.

async characteristic_read(characteristic, **kwargs)

Read value of the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

Returns

Tuple (value, extra).

characteristic_subscribe(characteristic, on_value, on_error=None)
async characteristic_write(characteristic, value, **kwargs)

Write a value to the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

characteristics = {'$metadata': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:$metadata>, 'level': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:level>}
static get_subclass(stype, mixin=None)
level
load_definition(spec)

Update characteristics of this instance based on serialized specs.

Parameters

spec – Dict most likely going to be coming from meadow - from some gateway informing us about its services and their characteristics.

metadata
on(name, *args, **kwargs)
optional = {}
serialize()

Return serialized version (most likely dict) if possible or None.

type = 'noise-sensor'

caspia.meadow.services.sensors.temperature module

class caspia.meadow.services.sensors.temperature.TemperatureSensorBase(name, include=())[source]

Bases: caspia.meadow.services.base.ServiceBase

Represents a temperature sensor.

Initialize new service.

Parameters
  • name – Name of the service (or just its path)

  • include – What optional characteristics to include. Tuple of their names.

property all_observables
auto_discovery = True
characteristic_cached_read(characteristic)

This method implements return value of characteristic’s value property.

characteristic_cached_write(characteristic, value)

This method implements writing to characteristic’s value property.

async characteristic_read(characteristic, **kwargs)

Read value of the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

Returns

Tuple (value, extra).

characteristic_subscribe(characteristic, on_value, on_error=None)
async characteristic_write(characteristic, value, **kwargs)

Write a value to the characteristic.

Parameters
  • characteristic – The characteristic to which the value should be written.

  • value – The value to be written.

  • kwargs – Dictionary with extra key (dictionary with metadata) and optionally a timeout (float specifing explicit timeout for the operation).

characteristics = {'$metadata': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:$metadata>, 'temp': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:temp>}
static get_subclass(stype, mixin=None)
load_definition(spec)

Update characteristics of this instance based on serialized specs.

Parameters

spec – Dict most likely going to be coming from meadow - from some gateway informing us about its services and their characteristics.

metadata
on(name, *args, **kwargs)
optional = {}
serialize()

Return serialized version (most likely dict) if possible or None.

temp
type = 'temperature-sensor'

Module contents