| # Copyright 2022 Google LLC |
| # |
| # Licensed under the Apache License, Version 2.0 (the "License"); |
| # you may not use this file except in compliance with the License. |
| # You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| """Module for DimmableLight endpoint command handler.""" |
| from typing import Any, Dict |
| |
| from gazoo_device import errors |
| |
| from local_agent.translation_layer.command_handlers import base |
| from local_agent.translation_layer.command_handlers.cluster_handlers import level |
| from local_agent.translation_layer.command_handlers.cluster_handlers import on_off |
| |
| ENDPOINT_CAPABILITY = 'dimmable_light' |
| |
| |
| class DimmableLightCommandHandler( |
| base.BaseCommandHandler, level.LevelControlHandler, on_off.OnOffHandler): |
| """Command handler for DimmableLight endpoint.""" |
| |
| SUPPORTED_METHODS = ( |
| level.LevelControlHandler.SUPPORTED_METHODS | |
| on_off.OnOffHandler.SUPPORTED_METHODS) |
| |
| def __init__(self, dut: Any) -> None: |
| super().__init__(dut) |
| self.endpoint = self.dut.dimmable_light |