caspia.gateway.services package¶
Subpackages¶
- caspia.gateway.services.meters package
- caspia.gateway.services.sensors package
- Subpackages
- caspia.gateway.services.sensors.carbondioxide package
- caspia.gateway.services.sensors.humidity package
- caspia.gateway.services.sensors.light package
- caspia.gateway.services.sensors.temperature package
- Submodules
- caspia.gateway.services.sensors.temperature.analog module
- caspia.gateway.services.sensors.temperature.mcp980x module
- caspia.gateway.services.sensors.temperature.scd30 module
- caspia.gateway.services.sensors.temperature.service module
- caspia.gateway.services.sensors.temperature.sht2x module
- Module contents
- Module contents
- Subpackages
Submodules¶
caspia.gateway.services.base module¶
-
class
caspia.gateway.services.base.GatewayService(config, network, storage)[source]¶ Bases:
caspia.meadow.client.gateway.ServiceGatewayMixin-
attach(connection)¶
-
property
attached¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
async
characteristic_read(characteristic, **kwargs)¶
-
async
characteristic_write(characteristic, value, **kwargs)¶
-
characteristics= {}¶
-
abstract property
dependant_components¶
-
detach()¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
optional= {}¶
-
async
published()¶
-
type= None¶
-
-
class
caspia.gateway.services.base.GatewayServiceMeta[source]¶ Bases:
caspia.meadow.services.base.ServiceMeta,abc.ABCMeta-
mro()¶ Return a type’s method resolution order.
-
register(subclass)¶ Register a virtual subclass of an ABC.
Returns the subclass, to allow usage as a class decorator.
-
caspia.gateway.services.blinds module¶
-
class
caspia.gateway.services.blinds.Blinds(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.base.GatewayService,caspia.meadow.services.blinds.BlindsBaseInitialize 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¶
-
attach(connection)¶
-
property
attached¶
-
auto_discovery= True¶
-
blind¶
-
calibrate¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
async
characteristic_read(characteristic, **kwargs)¶
-
characteristic_subscribe(characteristic, on_value, on_error=None)¶
-
async
characteristic_write(characteristic, value, **kwargs)¶
-
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>}¶
-
property
dependant_components¶
-
detach()¶
-
get_node()¶
-
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¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
on(name, *args, **kwargs)¶
-
optional= {}¶
-
async
published()¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
stop_movement¶
-
target_blind¶
-
target_position¶
-
target_tilt¶
-
tilt¶
-
type= 'blinds'¶
caspia.gateway.services.button module¶
Bases:
caspia.gateway.services.base.GatewayService,caspia.meadow.services.button.ButtonBaseInitialize new service.
- Parameters
name – Name of the service (or just its path)
include – What optional characteristics to include. Tuple of their names.
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.
caspia.gateway.services.door module¶
-
class
caspia.gateway.services.door.Door(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.base.GatewayService,caspia.meadow.services.door.DoorBaseInitialize 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¶
-
attach(connection)¶
-
property
attached¶
-
auto_discovery= True¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
async
characteristic_read(characteristic, **kwargs)¶
-
characteristic_subscribe(characteristic, on_value, on_error=None)¶
-
async
characteristic_write(characteristic, value, **kwargs)¶
-
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>}¶
-
property
dependant_components¶
-
detach()¶
-
get_node()¶
-
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¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
on(name, *args, **kwargs)¶
-
optional= {}¶
-
async
published()¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
type= 'door'¶
caspia.gateway.services.fan module¶
-
class
caspia.gateway.services.fan.Fan(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.relaybased.RelayBasedServiceMixin,caspia.gateway.services.base.GatewayService,caspia.meadow.services.fan.FanBase-
property
all_observables¶
-
attach(connection)¶
-
property
attached¶
-
auto_discovery= True¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
async
characteristic_read(characteristic, **kwargs)¶
-
characteristic_subscribe(characteristic, on_value, on_error=None)¶
-
async
characteristic_write(characteristic, value, **kwargs)¶
-
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>}¶
-
configure()¶
-
property
dependant_components¶
-
detach()¶
-
get_node()¶
-
static
get_subclass(stype, mixin=None)¶
-
is_on¶
-
async
is_on_read(**kwargs)¶
-
async
is_on_write(value, **kwargs)¶
-
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¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
on(name, *args, **kwargs)¶
-
async
on_component_event(component, event)¶
-
optional= {'speed'}¶
-
async
published()¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
speed¶
-
toggle¶
-
async
toggle_write(value, **kwargs)¶
-
type= 'fan'¶
-
property
caspia.gateway.services.irrigation module¶
-
class
caspia.gateway.services.irrigation.Irrigation(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.relaybased.RelayBasedServiceMixin,caspia.gateway.services.base.GatewayService,caspia.meadow.services.irrigation.IrrigationBase-
property
all_observables¶
-
attach(connection)¶
-
property
attached¶
-
auto_discovery= True¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
async
characteristic_read(characteristic, **kwargs)¶
-
characteristic_subscribe(characteristic, on_value, on_error=None)¶
-
async
characteristic_write(characteristic, value, **kwargs)¶
-
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>}¶
-
configure()¶
-
property
dependant_components¶
-
detach()¶
-
get_node()¶
-
static
get_subclass(stype, mixin=None)¶
-
is_on¶
-
async
is_on_read(**kwargs)¶
-
async
is_on_write(value, **kwargs)¶
-
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¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
on(name, *args, **kwargs)¶
-
async
on_component_event(component, event)¶
-
optional= {}¶
-
async
published()¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
toggle¶
-
async
toggle_write(value, **kwargs)¶
-
type= 'irrigation'¶
-
property
caspia.gateway.services.light module¶
-
class
caspia.gateway.services.light.Light(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.relaybased.RelayBasedServiceMixin,caspia.gateway.services.base.GatewayService,caspia.meadow.services.light.LightBase-
property
all_observables¶
-
attach(connection)¶
-
property
attached¶
-
auto_discovery= True¶
-
brightness¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
async
characteristic_read(characteristic, **kwargs)¶
-
characteristic_subscribe(characteristic, on_value, on_error=None)¶
-
async
characteristic_write(characteristic, value, **kwargs)¶
-
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>}¶
-
configure()¶
-
property
dependant_components¶
-
detach()¶
-
get_node()¶
-
static
get_subclass(stype, mixin=None)¶
-
hue¶
-
is_on¶
-
async
is_on_read(**kwargs)¶
-
async
is_on_write(value, **kwargs)¶
-
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¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
on(name, *args, **kwargs)¶
-
async
on_component_event(component, event)¶
-
optional= {'brightness', 'hue', 'saturation'}¶
-
async
published()¶
-
saturation¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
toggle¶
-
async
toggle_write(value, **kwargs)¶
-
type= 'light'¶
-
property
caspia.gateway.services.lockmechanism module¶
-
class
caspia.gateway.services.lockmechanism.LockMechanism(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.base.GatewayService,caspia.meadow.services.lockmechanism.LockMechanismBaseInitialize 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¶
-
attach(connection)¶
-
property
attached¶
-
auto_discovery= True¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
async
characteristic_read(characteristic, **kwargs)¶
-
characteristic_subscribe(characteristic, on_value, on_error=None)¶
-
async
characteristic_write(characteristic, value, **kwargs)¶
-
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>}¶
-
property
dependant_components¶
-
detach()¶
-
get_node()¶
-
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¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
on(name, *args, **kwargs)¶
-
optional= {}¶
-
async
published()¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
state¶
-
target_state¶
-
type= 'lock-mechanism'¶
caspia.gateway.services.outlet module¶
-
class
caspia.gateway.services.outlet.Outlet(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.relaybased.RelayBasedServiceMixin,caspia.gateway.services.base.GatewayService,caspia.meadow.services.outlet.OutletBase-
property
all_observables¶
-
attach(connection)¶
-
property
attached¶
-
auto_discovery= True¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
async
characteristic_read(characteristic, **kwargs)¶
-
characteristic_subscribe(characteristic, on_value, on_error=None)¶
-
async
characteristic_write(characteristic, value, **kwargs)¶
-
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>}¶
-
configure()¶
-
property
dependant_components¶
-
detach()¶
-
get_node()¶
-
static
get_subclass(stype, mixin=None)¶
-
is_on¶
-
async
is_on_read(**kwargs)¶
-
async
is_on_write(value, **kwargs)¶
-
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¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
on(name, *args, **kwargs)¶
-
async
on_component_event(component, event)¶
-
optional= {}¶
-
async
published()¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
toggle¶
-
async
toggle_write(value, **kwargs)¶
-
type= 'outlet'¶
-
property
caspia.gateway.services.pump module¶
-
class
caspia.gateway.services.pump.Pump(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.relaybased.RelayBasedServiceMixin,caspia.gateway.services.base.GatewayService,caspia.meadow.services.pump.PumpBase-
property
all_observables¶
-
attach(connection)¶
-
property
attached¶
-
auto_discovery= True¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
async
characteristic_read(characteristic, **kwargs)¶
-
characteristic_subscribe(characteristic, on_value, on_error=None)¶
-
async
characteristic_write(characteristic, value, **kwargs)¶
-
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>}¶
-
configure()¶
-
property
dependant_components¶
-
detach()¶
-
get_node()¶
-
static
get_subclass(stype, mixin=None)¶
-
is_on¶
-
async
is_on_read(**kwargs)¶
-
async
is_on_write(value, **kwargs)¶
-
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¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
on(name, *args, **kwargs)¶
-
async
on_component_event(component, event)¶
-
optional= {}¶
-
async
published()¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
toggle¶
-
async
toggle_write(value, **kwargs)¶
-
type= 'pump'¶
-
property
caspia.gateway.services.relaybased module¶
caspia.gateway.services.serial module¶
-
class
caspia.gateway.services.serial.Serial(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.base.GatewayService,caspia.meadow.services.serial.SerialBaseInitialize 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¶
-
attach(connection)¶
-
property
attached¶
-
auto_discovery= True¶
-
baudrate¶
-
characteristic_cached_read(characteristic)¶
-
characteristic_cached_write(characteristic, value_and_meta)¶
-
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>, '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¶
-
property
dependant_components¶
-
detach()¶
-
get_node()¶
-
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¶
-
async
notify(characteristic, value, if_changed=False, extra=None)¶
-
on(name, *args, **kwargs)¶
-
optional= {}¶
-
async
published()¶
-
receive¶
-
send¶
-
serialize()¶ Return serialized version (most likely dict) if possible or None.
-
type= 'serial'¶