Testcases extended
This commit is contained in:
parent
f5e747f428
commit
22fd8b53da
@ -1,7 +1,6 @@
|
||||
OUTDIR=testresults
|
||||
TEXFILE=$(OUTDIR)/testrun.tex
|
||||
PDFFILE=$(OUTDIR)/testrun.pdf
|
||||
TEXFILE_FULL=$(OUTDIR)/testrun_full.tex
|
||||
|
||||
release:
|
||||
cp -v $(PDFFILE) ../smart_brain/_testresults_
|
||||
@ -46,7 +45,6 @@ view_full:
|
||||
|
||||
localclean:
|
||||
@latexmk -quiet -output-directory=$(OUTDIR) -c $(TEXFILE) > /dev/null
|
||||
@latexmk -quiet -output-directory=$(OUTDIR) -c $(TEXFILE_FULL) > /dev/null
|
||||
@find . -name *~ -type f | xargs rm -f
|
||||
@find . -name __pycache__ -type d | xargs rm -rf
|
||||
|
||||
|
@ -18,11 +18,6 @@ logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
|
||||
|
||||
|
||||
# TODO: Not yet implemented devices ###################################
|
||||
def hue_sw_br_ct(mqtt_client, topic):
|
||||
logger.warning("Device type hue_sw_br_ct is not yet implemented. Topic %s will not be supported", topic)
|
||||
return None
|
||||
|
||||
|
||||
def shelly_pro3(mqtt_client, topic):
|
||||
logger.warning("Device type shelly_pro3 is not yet implemented. Topic %s will not be supported", topic)
|
||||
return None
|
||||
@ -168,6 +163,11 @@ class livarno_sw_br_ct(tradfri_light):
|
||||
super().__init__(mqtt_client, topic, enable_state=True, enable_brightness=True, enable_color_temp=True, send_on_power_on=False)
|
||||
|
||||
|
||||
class hue_sw_br_ct(tradfri_light):
|
||||
def __init__(self, mqtt_client, topic):
|
||||
super().__init__(mqtt_client, topic, enable_state=True, enable_brightness=True, enable_color_temp=True, send_on_power_on=False)
|
||||
|
||||
|
||||
class videv_sw(videv_light):
|
||||
def __init__(self, mqtt_client, topic):
|
||||
super().__init__(mqtt_client, topic, True, False, False, False)
|
||||
|
@ -12,6 +12,14 @@ class ffe_livingroom(rooms.ffe_livingroom):
|
||||
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
||||
|
||||
|
||||
class ffe_kitchen(rooms.ffe_kitchen):
|
||||
def __init__(self, mqtt_client):
|
||||
super().__init__(mqtt_client)
|
||||
# Enable/disable hue device, on power on/off
|
||||
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, True, self.light_main_light.power_on)
|
||||
self.switch_main_light.add_callback(self.switch_main_light.KEY_OUTPUT_0, False, self.light_main_light.power_off)
|
||||
|
||||
|
||||
class ffe_sleep(rooms.ffe_sleep):
|
||||
def __init__(self, mqtt_client):
|
||||
super().__init__(mqtt_client)
|
||||
@ -67,7 +75,7 @@ class ffe(object):
|
||||
def __init__(self, mqtt_client):
|
||||
self.diningroom = rooms.ffe_diningroom(mqtt_client)
|
||||
self.floor = rooms.ffe_floor(mqtt_client)
|
||||
self.kitchen = rooms.ffe_kitchen(mqtt_client)
|
||||
self.kitchen = ffe_kitchen(mqtt_client)
|
||||
self.livingroom = ffe_livingroom(mqtt_client)
|
||||
self.sleep = ffe_sleep(mqtt_client)
|
||||
|
||||
@ -81,6 +89,11 @@ class ffw(object):
|
||||
self.sleep = ffw_sleep(mqtt_client)
|
||||
|
||||
|
||||
class gar(object):
|
||||
def __init__(self, mqtt_client):
|
||||
self.garden = rooms.gar_garden(mqtt_client)
|
||||
|
||||
|
||||
class gfw(object):
|
||||
def __init__(self, mqtt_client):
|
||||
self.dirk = gfw_dirk(mqtt_client)
|
||||
@ -88,9 +101,15 @@ class gfw(object):
|
||||
self.marion = rooms.gfw_marion(mqtt_client)
|
||||
|
||||
|
||||
class stw(object):
|
||||
def __init__(self, mqtt_client):
|
||||
self.stairway = rooms.stairway(mqtt_client)
|
||||
|
||||
|
||||
class house(object):
|
||||
def __init__(self, mqtt_client):
|
||||
self.ffe = ffe(mqtt_client)
|
||||
self.ffw = ffw(mqtt_client)
|
||||
self.gar = gar(mqtt_client)
|
||||
self.gfw = gfw(mqtt_client)
|
||||
self.stairway = rooms.stairway(mqtt_client)
|
||||
self.stw = stw(mqtt_client)
|
||||
|
@ -12,8 +12,7 @@ import time
|
||||
import tests.help
|
||||
|
||||
|
||||
# TODO: Extend tests in simulation
|
||||
# - Compare with nodered capabilities + add garden
|
||||
# TODO: Extend tests
|
||||
# - Complete inter room functions
|
||||
# - cleanup (e.g. bedlight dirk, christmas star, ...)
|
||||
# - All off
|
||||
|
@ -1,4 +1,4 @@
|
||||
from .rooms import preconditions, ffe, ffw, gfe, gfw, stw, inter_room
|
||||
from .rooms import preconditions, ffe, ffw, gar, gfe, gfw, stw, inter_room
|
||||
|
||||
# TODO: Coverage, *Information (Chapter 1), ... ausblenden, wenn leer
|
||||
|
||||
@ -7,8 +7,8 @@ def add_all_testcases(ts, mc, h):
|
||||
preconditions(ts, mc, h)
|
||||
ffe(ts, mc, h)
|
||||
ffw(ts, mc, h)
|
||||
gar(ts, mc, h)
|
||||
gfe(ts, mc, h)
|
||||
gfw(ts, mc, h)
|
||||
stw(ts, mc, h)
|
||||
inter_room(ts, mc, h)
|
||||
# TODO: GARDEN
|
||||
|
@ -71,7 +71,7 @@ def device_follow_temp(ts, master, slave, single=False):
|
||||
)
|
||||
|
||||
|
||||
def device_flash_by_vers(ts, flash_device, trigger_device, start_state, trigger_vers, single=True):
|
||||
def device_flash_by_vers(ts, flash_device, trigger_device, start_state, trigger_vers, single=False):
|
||||
flash_device_flash_key = flash_device.KEY_OUTPUT_0
|
||||
if trigger_vers == FLASH_TRIGGER_LONGPUSH:
|
||||
trigger_device_key = trigger_device.KEY_LONGPUSH_0
|
||||
@ -140,9 +140,12 @@ def ffe(ts: testSession, mc: mqtt_client, h: house):
|
||||
# bed_light_di videv<-->zigbee
|
||||
device_follow_sw(ts, room.videv_bed_dirk_light, room.light_bed_dirk_light)
|
||||
device_follow_sw(ts, room.light_bed_dirk_light, room.videv_bed_dirk_light)
|
||||
#
|
||||
# bed_light_ma videv<-->zigbee
|
||||
device_follow_sw(ts, room.videv_bed_marion_light, room.switch_bed_marion_light)
|
||||
device_follow_sw(ts, room.switch_bed_marion_light, room.videv_bed_marion_light)
|
||||
# wardrobe videv<-->zigbee
|
||||
device_follow_sw(ts, room.videv_wardrobe_light, room.light_wardrobe_light)
|
||||
device_follow_sw(ts, room.light_wardrobe_light, room.videv_wardrobe_light)
|
||||
# Brightness and Colortemperature ####################
|
||||
device_follow_br(ts, room.videv_main_light, room.light_main_light, room.switch_main_light)
|
||||
device_follow_br(ts, room.light_main_light, room.videv_main_light, room.switch_main_light)
|
||||
@ -150,7 +153,9 @@ def ffe(ts: testSession, mc: mqtt_client, h: house):
|
||||
device_follow_ct(ts, room.light_main_light, room.videv_main_light, room.switch_main_light)
|
||||
device_follow_br(ts, room.videv_bed_dirk_light, room.light_bed_dirk_light, room.light_bed_dirk_light)
|
||||
device_follow_br(ts, room.light_bed_dirk_light, room.videv_bed_dirk_light, room.light_bed_dirk_light)
|
||||
# TODO: Wardrobe
|
||||
device_follow_br(ts, room.videv_wardrobe_light, room.light_wardrobe_light, room.light_wardrobe_light)
|
||||
device_follow_br(ts, room.light_wardrobe_light, room.videv_wardrobe_light, room.light_wardrobe_light)
|
||||
|
||||
# Temperature ########################################
|
||||
device_follow_temp(ts, room.videv_heating, room.valve_heating)
|
||||
|
||||
@ -183,13 +188,13 @@ def ffe(ts: testSession, mc: mqtt_client, h: house):
|
||||
device_follow_sw(ts, room.videv_circulation_pump, room.switch_circulation_pump)
|
||||
device_follow_sw(ts, room.switch_circulation_pump, room.videv_circulation_pump)
|
||||
# circulation pump feedback (flash test)
|
||||
device_flash_by_vers(ts, room.switch_main_light, room.switch_circulation_pump, True, FLASH_TRIGGER_ACTIVATE, single=True)
|
||||
device_flash_by_vers(ts, room.switch_main_light, room.switch_circulation_pump, False, FLASH_TRIGGER_ACTIVATE, single=True)
|
||||
device_flash_by_vers(ts, room.switch_main_light, room.switch_circulation_pump, True, FLASH_TRIGGER_ACTIVATE)
|
||||
device_flash_by_vers(ts, room.switch_main_light, room.switch_circulation_pump, False, FLASH_TRIGGER_ACTIVATE)
|
||||
# Brightness and Colortemperature ####################
|
||||
# TODO: device_follow_br(ts, room.videv_main_light, room.light_main_light, room.switch_main_light)
|
||||
# TODO: device_follow_br(ts, room.light_main_light, room.videv_main_light, room.switch_main_light)
|
||||
# TODO: device_follow_ct(ts, room.videv_main_light, room.light_main_light, room.switch_main_light)
|
||||
# TODO: device_follow_ct(ts, room.light_main_light, room.videv_main_light, room.switch_main_light)
|
||||
device_follow_br(ts, room.videv_main_light, room.light_main_light, room.switch_main_light)
|
||||
device_follow_br(ts, room.light_main_light, room.videv_main_light, room.switch_main_light)
|
||||
device_follow_ct(ts, room.videv_main_light, room.light_main_light, room.switch_main_light)
|
||||
device_follow_ct(ts, room.light_main_light, room.videv_main_light, room.switch_main_light)
|
||||
# Temperature ########################################
|
||||
device_follow_temp(ts, room.videv_heating, room.valve_heating)
|
||||
|
||||
@ -231,10 +236,17 @@ def ffw(ts: testSession, mc: mqtt_client, h: house):
|
||||
# main_light videv<-->shelly
|
||||
device_follow_sw(ts, room.videv_main_light, room.switch_main_light)
|
||||
device_follow_sw(ts, room.switch_main_light, room.videv_main_light)
|
||||
# TODO: window_light
|
||||
device_follow_sw(ts, room.videv_window_light, room.light_window_light)
|
||||
device_follow_sw(ts, room.light_window_light, room.videv_window_light)
|
||||
device_follow_sw(ts, room.switch_main_light, room.light_window_light)
|
||||
|
||||
# Brightness and Colortemperature ####################
|
||||
device_follow_br(ts, room.videv_main_light, room.light_main_light, room.switch_main_light)
|
||||
device_follow_br(ts, room.light_main_light, room.videv_main_light, room.switch_main_light)
|
||||
device_follow_br(ts, room.videv_window_light, room.light_window_light, room.light_window_light)
|
||||
device_follow_br(ts, room.light_window_light, room.videv_window_light, room.light_window_light)
|
||||
device_follow_ct(ts, room.videv_window_light, room.light_window_light, room.light_window_light)
|
||||
device_follow_ct(ts, room.light_window_light, room.videv_window_light, room.light_window_light)
|
||||
# Temperature ########################################
|
||||
device_follow_temp(ts, room.videv_heating, room.valve_heating)
|
||||
|
||||
@ -278,6 +290,19 @@ def ffw(ts: testSession, mc: mqtt_client, h: house):
|
||||
device_flash_by_vers(ts, room.switch_main_light, room.switch_main_light, False, FLASH_TRIGGER_LONGPUSH)
|
||||
|
||||
|
||||
def gar(ts: testSession, mc: mqtt_client, h: house):
|
||||
#
|
||||
# ffw.livingroom
|
||||
#
|
||||
room = h.gar.garden
|
||||
# Switching devices ##################################
|
||||
# main_light videv<-->shelly
|
||||
device_follow_sw(ts, room.videv_garland_light, room.switch_garland_light)
|
||||
device_follow_sw(ts, room.switch_garland_light, room.videv_garland_light)
|
||||
device_follow_sw(ts, room.videv_repeater, room.switch_repeater)
|
||||
device_follow_sw(ts, room.switch_repeater, room.videv_repeater)
|
||||
|
||||
|
||||
def gfe(ts: testSession, mc: mqtt_client, h: house):
|
||||
#
|
||||
# gfe.
|
||||
@ -339,6 +364,11 @@ def gfw(ts: testSession, mc: mqtt_client, h: house):
|
||||
device_follow_sw(ts, room.videv_window_light, room.light_window_light)
|
||||
device_follow_sw(ts, room.light_window_light, room.videv_window_light)
|
||||
device_follow_sw(ts, room.switch_main_light, room.light_window_light)
|
||||
# Brightness and Colortemperature ####################
|
||||
device_follow_br(ts, room.videv_window_light, room.light_window_light, room.light_window_light)
|
||||
device_follow_br(ts, room.light_window_light, room.videv_window_light, room.light_window_light)
|
||||
device_follow_ct(ts, room.videv_window_light, room.light_window_light, room.light_window_light)
|
||||
device_follow_ct(ts, room.light_window_light, room.videv_window_light, room.light_window_light)
|
||||
# Temperature ########################################
|
||||
device_follow_temp(ts, room.videv_heating, room.valve_heating)
|
||||
|
||||
@ -361,7 +391,7 @@ def stw(ts: testSession, mc: mqtt_client, h: house):
|
||||
#
|
||||
# stairways
|
||||
#
|
||||
room = h.stairway
|
||||
room = h.stw.stairway
|
||||
# Switching devices ##################################
|
||||
# main_light videv<-->shelly
|
||||
device_follow_sw(ts, room.videv_main_light, room.switch_main_light)
|
||||
@ -373,7 +403,7 @@ def stw(ts: testSession, mc: mqtt_client, h: house):
|
||||
|
||||
def inter_room(ts: testSession, mc: mqtt_client, h: house):
|
||||
#
|
||||
# gfw.dirk.swith
|
||||
# gfw.dirk.swith -> ffw.floor.switch
|
||||
#
|
||||
input = h.gfw.dirk.switch_main_light
|
||||
output = h.gfw.floor.switch_main_light
|
||||
|
Loading…
x
Reference in New Issue
Block a user