pyecodevices_rt2 package

Submodules

pyecodevices_rt2.abstractsensor module

class pyecodevices_rt2.abstractsensor.AbstractSensor(ecort2: EcoDevicesRT2, id: int, get_link: str, get_entry: str)[source]

Bases: object

Class representing an AbstractSensor

get_value(cached_ms: Optional[int] = None) float[source]

Return the current AbstractSensor status.

property value: float

pyecodevices_rt2.abstractswitch module

class pyecodevices_rt2.abstractswitch.AbstractSwitch(ecort2: EcoDevicesRT2, id: int, get_link: str, get_entry: str, on_link: str, off_link: str, toggle_link: str)[source]

Bases: object

Class representing an AbstractSwitch

get_status(cached_ms: Optional[int] = None) bool[source]

Return the current AbstractSwitch status.

off() bool[source]

Turn off a AbstractSwitch.

on() bool[source]

Turn on a the AbstractSwitch.

property status: bool
toggle() bool[source]

Toggle a AbstractSwitch.

pyecodevices_rt2.cli module

pyecodevices_rt2.const module

pyecodevices_rt2.counter module

class pyecodevices_rt2.counter.Counter(ecort2: EcoDevicesRT2, id: int)[source]

Bases: object

Class representing the Counter

add(value: int) bool[source]

Add a value to the current Counter value.

get_price(cached_ms: Optional[int] = None) float[source]

Return the price of counter.

get_value(cached_ms: Optional[int] = None) int[source]

Return the current Counter value.

property price: float
substrat(value: int) bool[source]

Substract a value to the current Counter value.

property value: int

pyecodevices_rt2.digitalinput module

class pyecodevices_rt2.digitalinput.DigitalInput(ecort2: EcoDevicesRT2, id: int)[source]

Bases: object

Class representing the DigitalInput

get_status(cached_ms: Optional[int] = None) bool[source]

Return the current DigitalInput status.

property status: bool

pyecodevices_rt2.ecodevices_rt2 module

class pyecodevices_rt2.ecodevices_rt2.EcoDevicesRT2(host: str, port: int = 80, apikey: str = '', timeout: int = 10, cached_ms: int = 0)[source]

Bases: object

Class representing the Ecodevices RT2 and its API

property apikey

Return the apikey.

property apiurl

Return the default apiurl.

property cached_ms

Return the maximum cached value in milliseconds.

get(command, command_value=None, command_entry=None, cached_ms: Optional[int] = None)[source]

Get value from api : http://{host}:{port}/api/xdevices.json?key={apikey}&{command}={command_value}, then get value {command_entry} in JSON response.

get_all_cached()[source]
property host

Return the hostname.

ping() bool[source]

pyecodevices_rt2.enocean module

class pyecodevices_rt2.enocean.EnOceanSensor(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSensor

Class representing the EnOceanSensor

class pyecodevices_rt2.enocean.EnOceanSwitch(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSwitch

Class representing the EnOceanSwitch

pyecodevices_rt2.exceptions module

Exceptions for Ecodevices RT2.

exception pyecodevices_rt2.exceptions.EcoDevicesRT2ConnectError[source]

Bases: Exception

Exception to indicate an error in connection.

exception pyecodevices_rt2.exceptions.EcoDevicesRT2RequestError[source]

Bases: Exception

Exception to indicate an error with an API request.

pyecodevices_rt2.post module

class pyecodevices_rt2.post.Post(ecort2: EcoDevicesRT2, id_post: int, id_subpost: Optional[int] = None)[source]

Bases: object

Class representing the Post or Sub-Post

get_index(cached_ms: Optional[int] = None) float[source]

Return the index of post/subpost.

get_index_day(cached_ms: Optional[int] = None) float[source]

Return the index of the current day of post/subpost.

get_instant(cached_ms: Optional[int] = None) float[source]

Return the instant power of post/subpost.

get_price(cached_ms: Optional[int] = None) float[source]

Return the price of post/subpost.

get_price_day(cached_ms: Optional[int] = None) float[source]

Return the price of the current day of post/subpost.

property index: float
property index_day: float
property instant: float
property price: float
property price_day: float

pyecodevices_rt2.relay module

class pyecodevices_rt2.relay.Relay(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSwitch

Class representing the Relay

pyecodevices_rt2.supplierindex module

class pyecodevices_rt2.supplierindex.SupplierIndex(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSensor

Class representing the SupplierIndex

get_price(cached_ms: Optional[int] = None) float[source]

Return the price of supplier index.

property price: float

pyecodevices_rt2.toroid module

class pyecodevices_rt2.toroid.Toroid(ecort2: EcoDevicesRT2, id: int)[source]

Bases: object

Class representing the Toroid

get_price(cached_ms: Optional[int] = None) float[source]

Return the price of toroid.

get_value(cached_ms: Optional[int] = None) float[source]

Return the index of toroid.

property price: float
property value: float

pyecodevices_rt2.virtualoutput module

class pyecodevices_rt2.virtualoutput.VirtualOutput(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSwitch

Class representing the VirtualOutput

pyecodevices_rt2.x4fp module

class pyecodevices_rt2.x4fp.X4FP(ecort2: EcoDevicesRT2, module_id: int, zone_id: int)[source]

Bases: object

Class representing the X4FP

get_mode(cached_ms: Optional[int] = None) int[source]

Return the current X4FP mode.

property mode: int

pyecodevices_rt2.xthl module

class pyecodevices_rt2.xthl.XTHL(ecort2: EcoDevicesRT2, id: int)[source]

Bases: object

Class representing the XTHL

get_humidity(cached_ms: Optional[int] = None) bool[source]

Return the current XTHL humidity.

get_luminosity(cached_ms: Optional[int] = None) bool[source]

Return the current XTHL luminosity.

get_temperature(cached_ms: Optional[int] = None) bool[source]

Return the current XTHL temperature.

property humidity: bool
property luminosity: bool
property temperature: bool

Module contents

Get information from GCE Ecodevices RT2.

class pyecodevices_rt2.AbstractSensor(ecort2: EcoDevicesRT2, id: int, get_link: str, get_entry: str)[source]

Bases: object

Class representing an AbstractSensor

get_value(cached_ms: Optional[int] = None) float[source]

Return the current AbstractSensor status.

property value: float
class pyecodevices_rt2.AbstractSwitch(ecort2: EcoDevicesRT2, id: int, get_link: str, get_entry: str, on_link: str, off_link: str, toggle_link: str)[source]

Bases: object

Class representing an AbstractSwitch

get_status(cached_ms: Optional[int] = None) bool[source]

Return the current AbstractSwitch status.

off() bool[source]

Turn off a AbstractSwitch.

on() bool[source]

Turn on a the AbstractSwitch.

property status: bool
toggle() bool[source]

Toggle a AbstractSwitch.

class pyecodevices_rt2.Counter(ecort2: EcoDevicesRT2, id: int)[source]

Bases: object

Class representing the Counter

add(value: int) bool[source]

Add a value to the current Counter value.

get_price(cached_ms: Optional[int] = None) float[source]

Return the price of counter.

get_value(cached_ms: Optional[int] = None) int[source]

Return the current Counter value.

property price: float
substrat(value: int) bool[source]

Substract a value to the current Counter value.

property value: int
class pyecodevices_rt2.DigitalInput(ecort2: EcoDevicesRT2, id: int)[source]

Bases: object

Class representing the DigitalInput

get_status(cached_ms: Optional[int] = None) bool[source]

Return the current DigitalInput status.

property status: bool
class pyecodevices_rt2.EcoDevicesRT2(host: str, port: int = 80, apikey: str = '', timeout: int = 10, cached_ms: int = 0)[source]

Bases: object

Class representing the Ecodevices RT2 and its API

property apikey

Return the apikey.

property apiurl

Return the default apiurl.

property cached_ms

Return the maximum cached value in milliseconds.

get(command, command_value=None, command_entry=None, cached_ms: Optional[int] = None)[source]

Get value from api : http://{host}:{port}/api/xdevices.json?key={apikey}&{command}={command_value}, then get value {command_entry} in JSON response.

get_all_cached()[source]
property host

Return the hostname.

ping() bool[source]
class pyecodevices_rt2.EnOceanSensor(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSensor

Class representing the EnOceanSensor

class pyecodevices_rt2.EnOceanSwitch(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSwitch

Class representing the EnOceanSwitch

class pyecodevices_rt2.Post(ecort2: EcoDevicesRT2, id_post: int, id_subpost: Optional[int] = None)[source]

Bases: object

Class representing the Post or Sub-Post

get_index(cached_ms: Optional[int] = None) float[source]

Return the index of post/subpost.

get_index_day(cached_ms: Optional[int] = None) float[source]

Return the index of the current day of post/subpost.

get_instant(cached_ms: Optional[int] = None) float[source]

Return the instant power of post/subpost.

get_price(cached_ms: Optional[int] = None) float[source]

Return the price of post/subpost.

get_price_day(cached_ms: Optional[int] = None) float[source]

Return the price of the current day of post/subpost.

property index: float
property index_day: float
property instant: float
property price: float
property price_day: float
class pyecodevices_rt2.Relay(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSwitch

Class representing the Relay

class pyecodevices_rt2.SupplierIndex(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSensor

Class representing the SupplierIndex

get_price(cached_ms: Optional[int] = None) float[source]

Return the price of supplier index.

property price: float
class pyecodevices_rt2.Toroid(ecort2: EcoDevicesRT2, id: int)[source]

Bases: object

Class representing the Toroid

get_price(cached_ms: Optional[int] = None) float[source]

Return the price of toroid.

get_value(cached_ms: Optional[int] = None) float[source]

Return the index of toroid.

property price: float
property value: float
class pyecodevices_rt2.VirtualOutput(ecort2: EcoDevicesRT2, id: int)[source]

Bases: AbstractSwitch

Class representing the VirtualOutput

class pyecodevices_rt2.X4FP(ecort2: EcoDevicesRT2, module_id: int, zone_id: int)[source]

Bases: object

Class representing the X4FP

get_mode(cached_ms: Optional[int] = None) int[source]

Return the current X4FP mode.

property mode: int
class pyecodevices_rt2.XTHL(ecort2: EcoDevicesRT2, id: int)[source]

Bases: object

Class representing the XTHL

get_humidity(cached_ms: Optional[int] = None) bool[source]

Return the current XTHL humidity.

get_luminosity(cached_ms: Optional[int] = None) bool[source]

Return the current XTHL luminosity.

get_temperature(cached_ms: Optional[int] = None) bool[source]

Return the current XTHL temperature.

property humidity: bool
property luminosity: bool
property temperature: bool