Skip to content

Commit

Permalink
Make a constant for EVENT_CHARACTERISTICS (#318)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Aug 6, 2023
1 parent a73ae3c commit ec81d62
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
12 changes: 5 additions & 7 deletions aiohomekit/controller/ble/pairing.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@
CharacteristicsTypes,
Transport,
)
from aiohomekit.model.characteristics import Characteristic, CharacteristicPermissions
from aiohomekit.model.characteristics import (
EVENT_CHARACTERISTICS,
Characteristic,
CharacteristicPermissions,
)
from aiohomekit.model.services import Service, ServicesTypes
from aiohomekit.pdu import OpCode, PDUStatus, decode_pdu, encode_pdu
from aiohomekit.protocol import get_session_keys
Expand Down Expand Up @@ -119,12 +123,6 @@
"246912DC-8FA3-82ED-DEA4-9EB91D8FC2EE", # Unknown Vendor char seen on Belkin Wemo Switch
}

EVENT_CHARACTERISTICS = {
# These are marked as [pr,ev] but make no sense to poll
# Doing so can cause phantom triggers.
CharacteristicsTypes.INPUT_EVENT,
CharacteristicsTypes.BUTTON_EVENT,
}

IGNORE_READ_CHARACTERISTICS = {
CharacteristicsTypes.SERVICE_SIGNATURE
Expand Down
10 changes: 10 additions & 0 deletions aiohomekit/model/characteristics/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@
from .types import CharacteristicShortUUID, CharacteristicUUID
from .units import CharacteristicUnits

EVENT_CHARACTERISTICS = {
CharacteristicsTypes.INPUT_EVENT,
CharacteristicsTypes.BUTTON_EVENT,
}
"""These characteristics are marked as [pr,ev] but make no sense to poll.
Doing so can cause phantom triggers.
"""

__all__ = [
"Characteristic",
"CharacteristicFormats",
Expand All @@ -59,4 +68,5 @@
"SwingModeValues",
"CurrentHeaterCoolerStateValues",
"TargetHeaterCoolerStateValues",
"EVENT_CHARACTERISTICS",
]

0 comments on commit ec81d62

Please sign in to comment.