caspia.gateway.services.meters package¶
Submodules¶
caspia.gateway.services.meters.electricity module¶
-
class
caspia.gateway.services.meters.electricity.ElectricityMeter(*args, **kwargs)[source]¶ Bases:
caspia.gateway.services.base.GatewayService,caspia.meadow.services.meters.electricity.ElectricityMeterBaseInitialize 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>, 'current_consumption': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:current_consumption>, 'total_consumption': <Characteristic <class 'caspia.meadow.services.base.ServiceMeta'>:total_consumption>}¶
-
current_consumption¶
-
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.
-
async
maintain_current_consumptions()[source]¶ Enter infinite loop and maintain current_consumption.
-
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.
-
total_consumption¶
-
type= 'electricity-meter'¶