| # Copyright 2021 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. |
| |
| """Mapping GDM capabilities to their handlers. |
| |
| This module provides the GDM_CAPABILITIES_TO_COMMAND_HANDLERS dict, |
| mapping each GDM capability to the corresponding command handler. |
| """ |
| import immutabledict |
| |
| from local_agent.translation_layer.command_handlers import color_temperature_light |
| from local_agent.translation_layer.command_handlers import common |
| from local_agent.translation_layer.command_handlers import on_off_light |
| from local_agent.translation_layer.command_handlers import door_lock |
| |
| |
| # GDM capability -> Matter endpoint command handlers |
| # TODO(b/216406955): Make command handler mapping dynamic generated |
| GDM_CAPABILITIES_TO_COMMAND_HANDLERS = immutabledict.immutabledict({ |
| color_temperature_light.ENDPOINT_CAPABILITY: |
| color_temperature_light.ColorTemperatureLightCommandHandler, |
| common.PWRPC_COMMON_CAPABILITY: common.CommonCommandHandler, |
| on_off_light.ENDPOINT_CAPABILITY: on_off_light.OnOffLightCommandHandler, |
| door_lock.ENDPOINT_CAPABILITY: door_lock.DoorLockCommandHandler |
| }) |