#######################################################
#
# NormalControl.py
# Python implementation of the Class NormalControl
# Generated by Enterprise Architect
# Created on:      20-7��-2021 14:11:11
# Original author: 70748
#
#######################################################
from .RemoteControl import RemoteControl
from .TV import TV


class NormalControl(RemoteControl):
    def __init__(self, tv: TV) -> None:
        super().__init__(tv)
        self._currentNumber = -1
        self._maxNumber = self._tv.getChannelTotal()-1

    def lastChannel(self):
        if self._currentNumber > 1:
            self._currentNumber -= 1
            self._tv.setChannel(self._currentNumber)

    def nextChannel(self):
        if self._currentNumber < self._maxNumber:
            self._currentNumber += 1
            self._tv.setChannel(self._currentNumber)

    def off(self):
        self._tv.off()

    def on(self):
        self._tv.on()
