#######################################################
#
# ControlButton.py
# Python implementation of the Class ControlButton
# Generated by Enterprise Architect
# Created on:      29-6��-2021 11:26:32
# Original author: 70748
#
#######################################################
from smart_home_v4.src.commnad.Command import Command
from smart_home_v4.src.ButtonStatus import ButtonStatus


class ControlButton:

    def __init__(self, name, commands: tuple[Command]):
        self._commands: tuple[Command] = commands
        self._name = name
        self._image = ""
        self._status = ButtonStatus.OFF

    def onClick(self):
        if self._status == ButtonStatus.OFF:
            self._commands[0].execute()
            self._status = ButtonStatus.ON
        elif self._status == ButtonStatus.ON:
            self._commands[1].execute()
            self._status = ButtonStatus.OFF

    def onLongPress(self):
        pass
