Skip to content

Commit

Permalink
Merge pull request #10 from protolab-rosenheim/switch-from-opcua-to-a…
Browse files Browse the repository at this point in the history
…syncua

Switch from opcua to asyncua
  • Loading branch information
Michael-List authored Jan 15, 2020
2 parents c38ada7 + 8f993c0 commit db98ca3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
20 changes: 10 additions & 10 deletions artnet/artnet_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def illuminate_multiple_slots(self, slots, color):

def illuminate_multiple_slots_opcua_call(self, parent, slot_name, color):
"""Only use this method for calls from python-opcua"""
from opcua import ua
from asyncua import ua
return [ua.Variant(self.illuminate_multiple_slots(slot_name.Value, color.Value), ua.VariantType.Boolean)]

def illuminate_slot(self, slot_name, color, history_to_illu, coll_history):
Expand All @@ -82,7 +82,7 @@ def illuminate_slot(self, slot_name, color, history_to_illu, coll_history):

def illuminate_slot_opcua_call(self, parent, slot_name, color):
"""Only use this method for calls from python-opcua"""
from opcua import ua
from asyncua import ua
return [ua.Variant(self.illuminate_slot(slot_name.Value, color.Value, 0, True), ua.VariantType.Boolean)]

def illuminate_slot_dont_coll_history(self, slot_name, color):
Expand All @@ -91,15 +91,15 @@ def illuminate_slot_dont_coll_history(self, slot_name, color):

def illuminate_slot_dont_coll_history_opcua_call(self, parent, slot_name, color):
"""Only use this method for calls from python-opcua"""
from opcua import ua
from asyncua import ua
return [ua.Variant(self.illuminate_slot_dont_coll_history(slot_name.Value,
color.Value), ua.VariantType.Boolean)]

def illuminate_slot_with_history(self, slot_name, color, history_to_illu):
return self.illuminate_slot(slot_name, color, history_to_illu, True)

def illuminate_slot_with_history_opcua_call(self, parent, slot_name, color, history_to_illu):
from opcua import ua
from asyncua import ua
return [ua.Variant(self.illuminate_slot_with_history(slot_name.Value,
color.Value,
history_to_illu.Value), ua.VariantType.Boolean)]
Expand All @@ -113,7 +113,7 @@ def illuminate_universe(self, universe, color_str):
return False

def illuminate_universe_opcua_call(self, parent, universe, color_str):
from opcua import ua
from asyncua import ua
return [ua.Variant(self.illuminate_universe(str(universe.Value), color_str.Value),ua.VariantType.Boolean)]

def illuminate_universe_rgb(self, universe, red, green, blue):
Expand All @@ -131,7 +131,7 @@ def illuminate_universe_rgb(self, universe, red, green, blue):
return False

def illuminate_universe_rgb_opcua_call(self, parent, universe, red, green, blue):
from opcua import ua
from asyncua import ua
return [ua.Variant(self.illuminate_universe_rgb(str(universe.Value),
red.Value,
green.Value,
Expand All @@ -150,7 +150,7 @@ def illuminate_all(self, color):
return False

def illuminate_all_opcua_call(self, parent, color):
from opcua import ua
from asyncua import ua
return [ua.Variant(self.illuminate_all(color.Value), ua.VariantType.Boolean)]

def illuminate_from_to(self, universe, start_led, end_led, color_str):
Expand All @@ -162,7 +162,7 @@ def illuminate_from_to(self, universe, start_led, end_led, color_str):
return False

def illuminate_from_to_opcua_call(self, parent, universe, start_led, end_led, color_str):
from opcua import ua
from asyncua import ua
return [ua.Variant(self.illuminate_from_to(str(universe.Value),
start_led.Value,
end_led.Value,
Expand All @@ -186,7 +186,7 @@ def illuminate_from_to_rgb(self, universe, start_led, end_led, red, green, blue)
return False

def illuminate_from_to_rgb_opcua_call(self, parent, universe, start_led, end_led, red, green, blue):
from opcua import ua
from asyncua import ua
return [ua.Variant(self.illuminate_from_to_rgb(str(universe.Value),
start_led.Value,
end_led.Value,
Expand All @@ -202,7 +202,7 @@ def all_off(self):
return True

def all_off_opcua_call(self, parent):
from opcua import ua
from asyncua import ua
return [ua.Variant(self.all_off(), ua.VariantType.Boolean)]

def _illuminate_from_to(self, start_led, end_led, led_strip, color):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

setup(
name='python-artnet',
version='0.1.2',
version='0.2.0',
description='ArtNet lib, proto_lab',
long_description=readme,
author='proto_lab',
Expand Down

0 comments on commit db98ca3

Please sign in to comment.