| # 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 common |
| from local_agent.translation_layer.command_handlers import light |
| from local_agent.translation_layer.command_handlers import lock |
| |
| |
| # GDM capability -> set of acceptable command handlers |
| GDM_CAPABILITIES_TO_COMMAND_HANDLERS = immutabledict.immutabledict({ |
| common.PWRPC_COMMON_CAPABILITY: {common.CommonCommandHandler,}, |
| light.PWRPC_LIGHT_CAPABILITY: {light.LightCommandHandler,}, |
| lock.PWRPC_LOCK_CAPABILITY: {lock.LockCommandHandler,} |
| }) |