Skip to content

Commit

Permalink
Added support for Gate type.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcel Naggatz authored and Marcel Naggatz committed Apr 15, 2020
1 parent 5a0c5b7 commit 00cdeee
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pyvlx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .lightening_device import Light, LighteningDevice
from .nodes import Nodes
from .opening_device import (
Blade, Blind, GarageDoor, OpeningDevice, RollerShutter, Window)
Blade, Blind, GarageDoor, Gate, OpeningDevice, RollerShutter, Window)
from .parameter import (
CurrentIntensity, CurrentPosition, Intensity, Parameter, Position,
SwitchParameter, SwitchParameterOff, SwitchParameterOn, UnknownIntensity,
Expand Down
6 changes: 5 additions & 1 deletion pyvlx/node_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from .log import PYVLXLOG
from .on_off_switch import OnOffSwitch
from .opening_device import (
Awning, Blade, Blind, GarageDoor, RollerShutter, Window)
Awning, Blade, Blind, GarageDoor, Gate, RollerShutter, Window)


def convert_frame_to_node(pyvlx, frame):
Expand All @@ -29,6 +29,10 @@ def convert_frame_to_node(pyvlx, frame):
return OnOffSwitch(pyvlx=pyvlx, node_id=frame.node_id, name=frame.name)
if frame.node_type == NodeTypeWithSubtype.GARAGE_DOOR_OPENER:
return GarageDoor(pyvlx=pyvlx, node_id=frame.node_id, name=frame.name)
if frame.node_type == NodeTypeWithSubtype.GATE_OPENER:
return Gate(pyvlx=pyvlx, node_id=frame.node_id, name=frame.name)
if frame.node_type == NodeTypeWithSubtype.GATE_OPENER_ANGULAR_POSITION:
return Gate(pyvlx=pyvlx, node_id=frame.node_id, name=frame.name)
if frame.node_type == NodeTypeWithSubtype.BLADE_OPENER:
return Blade(pyvlx=pyvlx, node_id=frame.node_id, name=frame.name)
if frame.node_type == NodeTypeWithSubtype.LIGHT:
Expand Down
2 changes: 2 additions & 0 deletions pyvlx/opening_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ class RollerShutter(OpeningDevice):
class GarageDoor(OpeningDevice):
"""GarageDoor object."""

class Gate(OpeningDevice):
"""Gate object."""

class Blade(OpeningDevice):
"""Blade object."""

0 comments on commit 00cdeee

Please sign in to comment.