2025-03-19 17:01:33 +01:00

60 lines
1.0 KiB
Python

from abc import ABC, abstractmethod
"""
Created on Tue Jan 21 16:26:13 2025
@author: Matthias Quintern
"""
class LedControlDevice(ABC):
@abstractmethod
def test_connection(self) -> None:
"""
Verify that the device is still properly connected.
If not, raises ConnectionError
"""
pass
@abstractmethod
def on(self):
"""
Set the led brightness to 100%
Returns
-------
None.
"""
pass
@abstractmethod
def off(self):
"""
Set the led brightness to 0%
Returns
-------
None.
"""
pass
@abstractmethod
def set_level(self, level:int):
"""
Set the led brightness to a certain level
Parameters
----------
level : int
Brightness level in percent.
Returns
-------
None.
"""
pass
def get_led_name(self) -> None|str:
return None
@abstractmethod
def __str__(self):
pass