Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for Gate type. #35

Merged
merged 1 commit into from
Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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."""