caspia.meadow.services package¶
Subpackages¶
- caspia.meadow.services.meters package
- caspia.meadow.services.sensors package
- Submodules
- caspia.meadow.services.sensors.carbondioxide module
- caspia.meadow.services.sensors.humidity module
- caspia.meadow.services.sensors.light module
- caspia.meadow.services.sensors.motion module
- caspia.meadow.services.sensors.noise module
- caspia.meadow.services.sensors.temperature module
- Module contents
Submodules¶
caspia.meadow.services.base module¶
-
class
caspia.meadow.services.base.ServiceBase(name, include=())[source]¶ Bases:
caspia.meadow.serialization.SerializableBase class for Meadow services.
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¶ True if this class should be discoverable using
get_subclass
-
characteristic_cached_read(characteristic)[source]¶ This method implements return value of characteristic’s value property.
-
characteristic_cached_write(characteristic, value)[source]¶ This method implements writing to characteristic’s value property.
-
async
characteristic_read(characteristic, **kwargs)[source]¶ 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).
-
async
characteristic_write(characteristic, value, **kwargs)[source]¶ 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>}¶ List of characteristics defined for the given class/service type.
Subclasses should not set this directly. This attribute is initialized automatically by ServiceMeta metaclass.
-
load_definition(spec)[source]¶ 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¶
-
optional= {}¶ Names of optional characteristic.
(subclasses might set this)
-
type= None¶ Type of the service
(subclasses should set this)
caspia.meadow.services.blinds module¶
-
class
caspia.meadow.services.blinds.BlindsBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a window blind.
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¶
-
blind¶
-
calibrate¶
-
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>, 'blind': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:blind>, 'calibrate': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:calibrate>, 'move_down': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:move_down>, 'move_up': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:move_up>, 'movement': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:movement>, 'stop_movement': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:stop_movement>, 'target_blind': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:target_blind>, 'target_position': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:target_position>, 'target_tilt': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:target_tilt>, 'tilt': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:tilt>}¶
-
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¶
-
move_down¶
-
move_up¶
-
movement¶
-
on(name, *args, **kwargs)¶
-
optional= {}¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
stop_movement¶
-
target_blind¶
-
target_position¶
-
target_tilt¶
-
tilt¶
-
type= 'blinds'¶
caspia.meadow.services.blindscontrol module¶
-
class
caspia.meadow.services.blindscontrol.BlindsControlBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a blinds controller.
Initialize new service.
- Parameters
name – Name of the service (or just its path)
include – What optional characteristics to include. Tuple of their names.
-
class
Mode[source]¶ Bases:
enum.EnumAn enumeration.
-
BLOCK_DIRECT_SUN_DOWN= 'block-direct-sun-or-down'¶
-
BLOCK_DIRECT_SUN_UP= 'block-direct-sun-or-up'¶
-
MANUAL= 'manual'¶
-
-
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>, 'mode': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:mode>}¶
-
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¶
-
mode¶
-
on(name, *args, **kwargs)¶
-
optional= {}¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
type= 'blinds-control'¶
caspia.meadow.services.button module¶
Bases:
caspia.meadow.services.base.ServiceBaseRepresents a button.
Initialize new service.
- Parameters
name – Name of the service (or just its path)
include – What optional characteristics to include. Tuple of their names.
This method implements return value of characteristic’s value property.
This method implements writing to characteristic’s value property.
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).
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).
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.
Return serialized version (most likely dict) if possible or None.
Bases:
caspia.meadow.services.button.ButtonEventRemove subscription of given observer.
Return current value of the observable.
Return serialized version (most likely dict) if possible or None.
Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
Manually trigger value change.
Bases:
caspia.reactive.observable.Observable,caspia.meadow.serialization.Serializable,caspia.meadow.serialization.DeserializableRemove subscription of given observer.
Return current value of the observable.
Return serialized version (most likely dict) if possible or None.
Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
Manually trigger value change.
Bases:
caspia.meadow.services.button.ButtonEventRemove subscription of given observer.
Return current value of the observable.
Return serialized version (most likely dict) if possible or None.
Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
Manually trigger value change.
Bases:
caspia.reactive.observers.Observer,caspia.meadow.serialization.Serializable,caspia.meadow.serialization.DeserializableThis class is to be used as “do” within an “on-do” rule.
For example let’s say, we want to have some Button trigger Button.event notification on ‘hold’ with interval 0.5. We must create “on-do” rule requesting this notification. Then the on-do rule will loke something like this:
OnDoRule( on=ButtonHoldEvent(my_button, 0.5, cancelling=True), do=ButtonTriggerEvent() )
- If this OnDoRule gets optimized by some gateway, it means, that the button is going to
send Button.event notification on the specified event. In this example, the Button.event notification is going to have value ‘hold’ and metadata of the notification will contain the interval=0.5.
Return serialized version (most likely dict) if possible or None.
caspia.meadow.services.characteristic module¶
-
class
caspia.meadow.services.characteristic.Characteristic(value_type, permissions, name=None, service=None, accepts_null=False, validate=(), description=None)[source]¶ Bases:
caspia.reactive.observable.Observable,caspia.meadow.serialization.Serializable,caspia.meadow.serialization.DeserializableInitialize new characteristic.
- Parameters
value_type – The value-type of the characteristic (string, e.g. ‘bool’)
permissions – String describing allowed operations with the characteristic value. For example ‘RW’ means “Readable and Notifiable”. Valid chars are “R” “W” and “N”.
name – The name of the characteristic. If None, must be provided later.
service – The parent service for this characteristic. If None, must be provided later.
accepts_null – Boolean indicating, whether None is valid value for the characteristic.
validate – Tuple of extra validators for the characteristic value. Validator is a callable(value) -> None, which raises ValueError for invalid value.
description – Optional description of the characteristic used for documentation.
-
accepts_null= None¶ True if value might be null
-
dispose_subscription(observer)¶ Remove subscription of given observer.
-
do(*args, **kwargs)¶
-
exception_handler(exception, stack, **kwargs)¶
-
extra_validators= None¶ Tuple of extra validators
-
name= None¶ Name of the Characteristic
-
property
notifiable¶
-
async
on_error_notification(error, **_)[source]¶ Shall be Called on a new incoming notification (containing error).
- Parameters
error – the error
-
async
on_value_notification(value, extra, **_)[source]¶ Shall be called on new incoming notification via meadow connection.
- Parameters
value – is the raw - serialized value received
extra – dictionary of value’s metadata
-
permissions= None¶ Value permissions (Readable, Writable, Notifiable) as string. For example “RWN”.
-
property
readable¶
-
serialized_type= 'characteristic-notification'¶
-
service= None¶ Parent service
-
subscribe(*args, **kwargs)¶ Create observer using given *args and **kwargs and subscribe to its changes.
Returns disposable representing the subscription => call .dispose() to unsubscribe.
-
async
trigger(value: T, **kwargs)¶ Manually trigger value change.
-
property
value¶
-
property
value_and_extra¶
-
value_type= None¶ Value type of the characteristic
-
property
writable¶
caspia.meadow.services.display module¶
-
class
caspia.meadow.services.display.DisplayBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents fully controlable display.
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>, 'update': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:update>}¶
-
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.
-
type= 'display'¶
-
update¶
caspia.meadow.services.door module¶
-
class
caspia.meadow.services.door.DoorBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a door.
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>, 'is_handle_down': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_handle_down>, 'is_open': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_open>}¶
-
static
get_subclass(stype, mixin=None)¶
-
is_handle_down¶
-
is_open¶
-
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= 'door'¶
caspia.meadow.services.fan module¶
-
class
caspia.meadow.services.fan.FanBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a fan.
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>, 'is_on': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_on>, 'speed': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:speed>, 'toggle': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:toggle>}¶
-
static
get_subclass(stype, mixin=None)¶
-
is_on¶
-
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= {'speed'}¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
speed¶
-
toggle¶
-
type= 'fan'¶
caspia.meadow.services.irrigation module¶
-
class
caspia.meadow.services.irrigation.IrrigationBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents an irrigation.
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>, 'is_on': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_on>, 'toggle': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:toggle>}¶
-
static
get_subclass(stype, mixin=None)¶
-
is_on¶
-
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.
-
toggle¶
-
type= 'irrigation'¶
caspia.meadow.services.light module¶
-
class
caspia.meadow.services.light.LightBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a light (of any type, lightbulb, LED etc).
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¶
-
brightness¶
-
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>, 'brightness': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:brightness>, 'hue': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:hue>, 'is_on': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_on>, 'saturation': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:saturation>, 'toggle': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:toggle>}¶
-
static
get_subclass(stype, mixin=None)¶
-
hue¶
-
is_on¶
-
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= {'brightness', 'hue', 'saturation'}¶
-
saturation¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
toggle¶
-
type= 'light'¶
-
class
caspia.meadow.services.light.LightGroup(name)[source]¶ Bases:
caspia.meadow.services.light.LightBaseUtility class for light grouping.
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¶
-
brightness¶
-
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)[source]¶ 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)[source]¶ 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>, 'brightness': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:brightness>, 'hue': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:hue>, 'is_on': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_on>, 'saturation': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:saturation>, 'toggle': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:toggle>}¶
-
static
get_subclass(stype, mixin=None)¶
-
hue¶
-
is_on¶
-
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= {'brightness', 'hue', 'saturation'}¶
-
saturation¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
toggle¶
-
type= 'light'¶
caspia.meadow.services.lockmechanism module¶
-
class
caspia.meadow.services.lockmechanism.LockMechanismBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a physical lock.
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>, 'state': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:state>, 'target_state': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:target_state>}¶
-
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.
-
state¶
-
target_state¶
-
type= 'lock-mechanism'¶
caspia.meadow.services.metadataprovider module¶
-
class
caspia.meadow.services.metadataprovider.MetadataProviderBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseInitialize 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>, 'create': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:create>, 'entries': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:entries>, 'remove': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:remove>}¶
-
create¶
-
entries¶
-
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= {}¶
-
remove¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
type= 'metadata-provider'¶
caspia.meadow.services.outlet module¶
-
class
caspia.meadow.services.outlet.OutletBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a power outlet.
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>, 'is_on': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_on>, 'toggle': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:toggle>}¶
-
static
get_subclass(stype, mixin=None)¶
-
is_on¶
-
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.
-
toggle¶
-
type= 'outlet'¶
caspia.meadow.services.presence module¶
-
class
caspia.meadow.services.presence.PresenceBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseProvides information about user presence.
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>, 'state': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:state>, 'update': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:update>}¶
-
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.
-
state¶
-
type= 'presence'¶
-
update¶
caspia.meadow.services.pump module¶
-
class
caspia.meadow.services.pump.PumpBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a pump (e.g. circulation pump).
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>, 'is_on': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_on>, 'toggle': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:toggle>}¶
-
static
get_subclass(stype, mixin=None)¶
-
is_on¶
-
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.
-
toggle¶
-
type= 'pump'¶
caspia.meadow.services.serial module¶
-
class
caspia.meadow.services.serial.SerialBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a serial device.
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¶
-
baudrate¶
-
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>, 'baudrate': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:baudrate>, 'data_available': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:data_available>, 'receive': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:receive>, 'send': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:send>}¶
-
data_available¶
-
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= {}¶
-
receive¶
-
send¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
type= 'serial'¶
caspia.meadow.services.sun module¶
-
class
caspia.meadow.services.sun.SunBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseGives information about sun.
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¶
-
azimuth¶
-
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>, 'azimuth': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:azimuth>, 'elevation': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:elevation>, 'sunrise': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:sunrise>, 'sunset': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:sunset>}¶
-
elevation¶
-
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.
-
sunrise¶
-
sunset¶
-
type= 'sun'¶
caspia.meadow.services.switch module¶
-
class
caspia.meadow.services.switch.SwitchBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a binary switch.
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>, 'is_on': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_on>}¶
-
static
get_subclass(stype, mixin=None)¶
-
is_on¶
-
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= 'switch'¶
caspia.meadow.services.thermostat module¶
-
class
caspia.meadow.services.thermostat.ThermostatBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a thermsotat.
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>, 'current_state': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:current_state>, 'current_temp': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:current_temp>, 'target_state': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:target_state>, 'target_temp': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:target_temp>}¶
-
current_state¶
-
current_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.
-
target_state¶
-
target_temp¶
-
type= 'thermostat'¶
caspia.meadow.services.weather module¶
-
class
caspia.meadow.services.weather.DataPointSchema(key, description, **schema)[source]¶ Bases:
object
-
class
caspia.meadow.services.weather.WeatherBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseProvides information about current weather and its forecast. The characteristic’s values are dictionaries looking like:
{ 'temperature': 24.5, 'precip_probability: 1, ... }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>, 'current': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:current>, 'today': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:today>, 'tomorrow': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:tomorrow>, 'upcoming': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:upcoming>, 'update': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:update>}¶
-
current¶
-
datapoint_schemas= {'cloud_cover': <caspia.meadow.services.weather.DataPointSchema object>, 'humidity': <caspia.meadow.services.weather.DataPointSchema object>, 'precip_accumulation': <caspia.meadow.services.weather.DataPointSchema object>, 'precip_intensity': <caspia.meadow.services.weather.DataPointSchema object>, 'precip_probability': <caspia.meadow.services.weather.DataPointSchema object>, 'precip_type': <caspia.meadow.services.weather.DataPointSchema object>, 'pressure': <caspia.meadow.services.weather.DataPointSchema object>, 'temperature': <caspia.meadow.services.weather.DataPointSchema object>, 'wind_bearing': <caspia.meadow.services.weather.DataPointSchema object>, 'wind_gust': <caspia.meadow.services.weather.DataPointSchema object>, 'wind_speed': <caspia.meadow.services.weather.DataPointSchema object>}¶
-
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= {}¶
-
async
post_report(report: caspia.meadow.services.weather.WeatherReport)[source]¶ Update the service with given WeatherReport. This just writes the report to the update characteristic.
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
today¶
-
tomorrow¶
-
type= 'weather'¶
-
upcoming¶
-
update¶
caspia.meadow.services.window module¶
-
class
caspia.meadow.services.window.WindowBase(name, include=())[source]¶ Bases:
caspia.meadow.services.base.ServiceBaseRepresents a window.
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>, 'is_open': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:is_open>}¶
-
static
get_subclass(stype, mixin=None)¶
-
is_open¶
-
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= {'is_open'}¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
type= 'window'¶
Module contents¶
The caspia.meadow.services module contains
definitions of all standard services support by Meadow.
Those definitions are in a form of subclasses
of base.ServiceBase.