pyziggy.device_bases¶
Autogenerated classes abstracting over parameters that are commonly occurring
together. These are used by the pyziggy generator when populating your AvailableDevices
class. User code should access these classes through the AvailableDevices
object, but
it’s not supposed to instantiate them.
For example if a device has a toggleable state parameter, a settable
brightness and settable color_temp parameter at the same time, it will inherit from
pyziggy.device_bases.LightWithColorTemp
, as opposed to inheriting just from
pyziggy.devices_client.Device
and having the same parameters.
This allows you to write more succinct automation code with type safety.
For example, you can write the following code to set all of your lights, that have this capability, to a common color temperature:
for device in devices.get_devices():
if isinstance(device, LightWithColorTemp):
device.color_temp.set(370)
Classes
|
|
|
|
|
|
|
|
|
- class pyziggy.device_bases.LightWithColor(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9, arg10, arg11)¶
Bases:
LightWithColorTemp
- class pyziggy.device_bases.LightWithColorTemp(arg0, arg1, arg2, arg3)¶
Bases:
LightWithDimming
- class pyziggy.device_bases.LightWithDimming(arg0, arg1)¶
Bases:
object