set up other moes pad
This commit is contained in:
@@ -2,6 +2,10 @@ moes_driver:
|
|||||||
module: moes_pad
|
module: moes_pad
|
||||||
class: MoesBridge
|
class: MoesBridge
|
||||||
|
|
||||||
|
moes1:
|
||||||
|
module: moes_pad
|
||||||
|
class: MoesPad
|
||||||
|
|
||||||
moes2:
|
moes2:
|
||||||
module: moes_pad
|
module: moes_pad
|
||||||
class: MoesPad
|
class: MoesPad
|
||||||
@@ -49,6 +49,8 @@ class MoesBridge(ADBase):
|
|||||||
|
|
||||||
|
|
||||||
class MoesPad(ADBase):
|
class MoesPad(ADBase):
|
||||||
|
"""Specfic implementation of a Moes Pad."""
|
||||||
|
|
||||||
def initialize(self):
|
def initialize(self):
|
||||||
self.adapi = self.get_ad_api()
|
self.adapi = self.get_ad_api()
|
||||||
self.log = self.adapi.log
|
self.log = self.adapi.log
|
||||||
@@ -70,4 +72,8 @@ class MoesPad(ADBase):
|
|||||||
case MoesButtons.TOP_RIGHT:
|
case MoesButtons.TOP_RIGHT:
|
||||||
self.adapi.call_service('light/toggle', entity_id='light.bedroom_john')
|
self.adapi.call_service('light/toggle', entity_id='light.bedroom_john')
|
||||||
case MoesButtons.BOTTOM_LEFT:
|
case MoesButtons.BOTTOM_LEFT:
|
||||||
self.adapi.call_service('light/toggle', entity_id='light.h6076_2')
|
self.adapi.call_service('light/toggle', entity_id='light.bedroom_stick')
|
||||||
|
case MoesButtons.BOTTOM_RIGHT:
|
||||||
|
for e in ('bedroom_stick', 'bedroom_john', 'bedroom_sydney'):
|
||||||
|
if self.adapi.get_state(e) == 'on':
|
||||||
|
self.adapi.call_service('light/toggle', entity_id=e)
|
||||||
|
|||||||
Reference in New Issue
Block a user