blob: f5dd7eb9d7ae79a7930b4b249b73e1d742aa2eee [file] [log] [blame]
# 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.
"""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 dimmable_light
from local_agent.translation_layer.command_handlers import door_lock
from local_agent.translation_layer.command_handlers import on_off_light
GDM_CAPABILITIES_TO_COMMAND_HANDLERS = immutabledict.immutabledict({
color_temperature_light.ENDPOINT_CAPABILITY:
color_temperature_light.ColorTemperatureLightCommandHandler,
common.PWRPC_COMMON_CAPABILITY: common.CommonCommandHandler,
dimmable_light.ENDPOINT_CAPABILITY: dimmable_light.DimmableLightCommandHandler,
door_lock.ENDPOINT_CAPABILITY: door_lock.DoorLockCommandHandler,
on_off_light.ENDPOINT_CAPABILITY: on_off_light.OnOffLightCommandHandler,
})