Repository: XKNX/xknx
Pull request #1537 (2024-08-02 17:44:16)

Add DPT 1 definitions
<!--
  You are awesome! Thanks for contributing to our project!
  Please, DO NOT DELETE ANY TEXT from this template!.
-->
## Description
<!--
Please include a summary of the change and which issue is fixed.
Please also include relevant motivation and context.
List any dependencies that are required for this change.
-->


Fixes # (issue)

## Type of change
<!--
Please tick the applicable options.
NOTE: Ticking multiple options most likely indicates
that your change is to big and it is suggested to split it into several smaller PRs.
-->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Code quality improvements to existing code or addition of tests

## Checklist

- [ ] The documentation has been adjusted accordingly
- [x] Tests have been added that prove the fix is effective or that the feature works
- [x] The changes are documented in the changelog (docs/changelog.md)

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/XKNX/xknx/pull/1537?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XKNX) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 96.88%. Comparing base [(`f936677`)](https://app.codecov.io/gh/XKNX/xknx/commit/f9366770faa8da9072ae242f3cce99834cc2a0da?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XKNX) to head [(`a300c53`)](https://app.codecov.io/gh/XKNX/xknx/commit/a300c53f26dfc8f277c133698c9efde4916e8467?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XKNX).

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://app.codecov.io/gh/XKNX/xknx/pull/1537/graphs/tree.svg?width=650&height=150&src=pr&token=irWbIygS84&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XKNX)](https://app.codecov.io/gh/XKNX/xknx/pull/1537?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XKNX)

```diff
@@            Coverage Diff             @@
##             main    #1537      +/-   ##
==========================================
+ Coverage   96.80%   96.88%   +0.07%     
==========================================
  Files         157      157              
  Lines       10303    10556     +253     
==========================================
+ Hits         9974    10227     +253     
  Misses        329      329              
```

| [Files](https://app.codecov.io/gh/XKNX/xknx/pull/1537?dropdown=coverage&src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XKNX) | Coverage Δ | |
|---|---|---|
| [xknx/dpt/\_\_init\_\_.py](https://app.codecov.io/gh/XKNX/xknx/pull/1537?src=pr&el=tree&filepath=xknx%2Fdpt%2F__init__.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XKNX#diff-eGtueC9kcHQvX19pbml0X18ucHk=) | `100.00% <100.00%> (ø)` | |
| [xknx/dpt/dpt\_1.py](https://app.codecov.io/gh/XKNX/xknx/pull/1537?src=pr&el=tree&filepath=xknx%2Fdpt%2Fdpt_1.py&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=XKNX#diff-eGtueC9kcHQvZHB0XzEucHk=) | `100.00% <100.00%> (ø)` | |

</details>

Patch:
diff --git a/docs/changelog.md b/docs/changelog.md
index 658f10df..c82e5169 100644
--- a/docs/changelog.md
+++ b/docs/changelog.md
@@ -6,6 +6,12 @@ nav_order: 2
 
 # Changelog
 
+# Unreleased changes
+
+### DPT
+
+- Add DPT 1 definitions (as of KNX Specification 03_07_02 version 02.02.01)
+
 # 3.0.0 Eager telegram decoding, DPTComplex and DPTEnum 2024-07-31
 
 ### Breaking changes
@@ -53,7 +59,7 @@ nav_order: 2
   - 242.600 - DPTColorXYY - XYYColor
   - 251.600 - DPTColorRGBW - RGBWColor
   - 20.60102 - DPTHVACStatus - HVACStatus (removed DPTControllerStatus in favour of this)
-- DPTEnum: Common interface for DPT trath enumueration values. Transcoders accept Enum, string or raw integer values for encoding.
+- DPTEnum: Common interface for DPT representing enumueration values. Transcoders accept Enum, string or raw integer values for encoding.
   - 1.007 - DPTStep
   - 1.008 - DPTUpDown
   - 1.100 - DPTHeatCool
diff --git a/xknx/dpt/__init__.py b/xknx/dpt/__init__.py
index ad36d667..e2d0f42c 100644
--- a/xknx/dpt/__init__.py
+++ b/xknx/dpt/__init__.py
@@ -7,7 +7,34 @@ Module for encoding and decoding KNX datatypes.
 
 # ruff: noqa: F401
 from .dpt import DPTBase, DPTComplex, DPTComplexData, DPTEnum, DPTEnumData, DPTNumeric
-from .dpt_1 import DPTHeatCool, DPTStep, DPTUpDown
+from .dpt_1 import (
+    DPTAck,
+    DPTAlarm,
+    DPTBinaryValue,
+    DPTBool,
+    DPTConsumerProducer,
+    DPTDayNight,
+    DPTDimSendStyle,
+    DPTEnable,
+    DPTEnergyDirection,
+    DPTHeatCool,
+    DPTInputSource,
+    DPTInvert,
+    DPTLogicalFunction,
+    DPTOccupancy,
+    DPTOpenClose,
+    DPTRamp,
+    DPTReset,
+    DPTSceneAB,
+    DPTShutterBlindsMode,
+    DPTStart,
+    DPTState,
+    DPTStep,
+    DPTSwitch,
+    DPTTrigger,
+    DPTUpDown,
+    DPTWindowDoor,
+)
 from .dpt_3 import DPTControlBlinds, DPTControlDimming
 from .dpt_5 import (
     DPTAngle,
diff --git a/xknx/dpt/dpt_1.py b/xknx/dpt/dpt_1.py
index 452dc969..33dcaa7c 100644
--- a/xknx/dpt/dpt_1.py
+++ b/xknx/dpt/dpt_1.py
@@ -14,6 +14,132 @@ class DPT1BitEnum(DPTEnum[EnumDataT]):
     dpt_main_number = 1
 
 
+class Switch(DPTEnumData):
+    """Enum for switching control."""
+
+    OFF = False
+    ON = True
+
+
+class DPTSwitch(DPT1BitEnum[Switch]):
+    """Abstraction for KNX 1-Bit switch value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 1
+    value_type = "switch"
+    data_type = Switch
+
+    @classmethod
+    def _to_knx(cls, value: Switch) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Bool(DPTEnumData):
+    """Enum for switching control."""
+
+    FALSE = False
+    TRUE = True
+
+
+class DPTBool(DPT1BitEnum[Bool]):
+    """Abstraction for KNX 1-Bit bool value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 2
+    value_type = "bool"
+    data_type = Bool
+
+    @classmethod
+    def _to_knx(cls, value: Bool) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Enable(DPTEnumData):
+    """Enum for enable control."""
+
+    DISABLE = False
+    ENABLE = True
+
+
+class DPTEnable(DPT1BitEnum[Enable]):
+    """Abstraction for KNX 1-Bit enable value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 3
+    value_type = "enable"
+    data_type = Enable
+
+    @classmethod
+    def _to_knx(cls, value: Enable) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Ramp(DPTEnumData):
+    """Enum for ramp control."""
+
+    NO_RAMP = False
+    RAMP = True
+
+
+class DPTRamp(DPT1BitEnum[Ramp]):
+    """Abstraction for KNX 1-Bit ramp value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 4
+    value_type = "ramp"
+    data_type = Ramp
+
+    @classmethod
+    def _to_knx(cls, value: Ramp) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Alarm(DPTEnumData):
+    """Enum for alarm control."""
+
+    NO_ALARM = False
+    ALARM = True
+
+
+class DPTAlarm(DPT1BitEnum[Alarm]):
+    """Abstraction for KNX 1-Bit alarm value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 5
+    value_type = "alarm"
+    data_type = Alarm
+
+    @classmethod
+    def _to_knx(cls, value: Alarm) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class BinaryValue(DPTEnumData):
+    """Enum for binary value control."""
+
+    LOW = False
+    HIGH = True
+
+
+class DPTBinaryValue(DPT1BitEnum[BinaryValue]):
+    """Abstraction for KNX 1-Bit binary_value value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 6
+    value_type = "binary_value"
+    data_type = BinaryValue
+
+    @classmethod
+    def _to_knx(cls, value: BinaryValue) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
 class Step(DPTEnumData):
     """Enum for dimming control."""
 
@@ -22,11 +148,7 @@ class Step(DPTEnumData):
 
 
 class DPTStep(DPT1BitEnum[Step]):
-    """
-    Abstraction for KNX 1-Bit step value.
-
-    DPT 1.007
-    """
+    """Abstraction for KNX 1-Bit step value."""
 
     dpt_main_number = 1
     dpt_sub_number = 7
@@ -47,11 +169,7 @@ class UpDown(DPTEnumData):
 
 
 class DPTUpDown(DPT1BitEnum[UpDown]):
-    """
-    Abstraction for KNX 1-Bit up/down value.
-
-    DPT 1.008
-    """
+    """Abstraction for KNX 1-Bit up/down value."""
 
     dpt_main_number = 1
     dpt_sub_number = 8
@@ -64,6 +182,321 @@ class DPTUpDown(DPT1BitEnum[UpDown]):
         return DPTBinary(value.value)
 
 
+class OpenClose(DPTEnumData):
+    """Enum for dimming control."""
+
+    OPEN = False
+    CLOSE = True
+
+
+class DPTOpenClose(DPT1BitEnum[OpenClose]):
+    """Abstraction for KNX 1-Bit open_close value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 9
+    value_type = "open_close"
+    data_type = OpenClose
+
+    @classmethod
+    def _to_knx(cls, value: OpenClose) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Start(DPTEnumData):
+    """Enum for dimming control."""
+
+    STOP = False
+    START = True
+
+
+class DPTStart(DPT1BitEnum[Start]):
+    """Abstraction for KNX 1-Bit start value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 10
+    value_type = "start"
+    data_type = Start
+
+    @classmethod
+    def _to_knx(cls, value: Start) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class State(DPTEnumData):
+    """Enum for dimming control."""
+
+    INACTIVE = False
+    ACTIVE = True
+
+
+class DPTState(DPT1BitEnum[State]):
+    """Abstraction for KNX 1-Bit state value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 11
+    value_type = "state"
+    data_type = State
+
+    @classmethod
+    def _to_knx(cls, value: State) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Invert(DPTEnumData):
+    """Enum for dimming control."""
+
+    NOT_INVERTED = False
+    INVERTED = True
+
+
+class DPTInvert(DPT1BitEnum[Invert]):
+    """Abstraction for KNX 1-Bit invert value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 12
+    value_type = "invert"
+    data_type = Invert
+
+    @classmethod
+    def _to_knx(cls, value: Invert) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class DimSendStyle(DPTEnumData):
+    """Enum for dimming control."""
+
+    START_STOP = False
+    CYCLICALLY = True
+
+
+class DPTDimSendStyle(DPT1BitEnum[DimSendStyle]):
+    """Abstraction for KNX 1-Bit dim_send_style value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 13
+    value_type = "dim_send_style"
+    data_type = DimSendStyle
+
+    @classmethod
+    def _to_knx(cls, value: DimSendStyle) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class InputSource(DPTEnumData):
+    """Enum for dimming control."""
+
+    FIXED = False
+    CALCULATED = True
+
+
+class DPTInputSource(DPT1BitEnum[InputSource]):
+    """Abstraction for KNX 1-Bit input_source value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 14
+    value_type = "input_source"
+    data_type = InputSource
+
+    @classmethod
+    def _to_knx(cls, value: InputSource) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Reset(DPTEnumData):
+    """Enum for dimming control."""
+
+    NO_ACTION = False
+    RESET = True
+
+
+class DPTReset(DPT1BitEnum[Reset]):
+    """Abstraction for KNX 1-Bit reset value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 15
+    value_type = "reset"
+    data_type = Reset
+
+    @classmethod
+    def _to_knx(cls, value: Reset) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Ack(DPTEnumData):
+    """Enum for dimming control."""
+
+    NO_ACTION = False
+    ACKNOWLEDGE = True
+
+
+class DPTAck(DPT1BitEnum[Ack]):
+    """Abstraction for KNX 1-Bit ack value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 16
+    value_type = "ack"
+    data_type = Ack
+
+    @classmethod
+    def _to_knx(cls, value: Ack) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Trigger(DPTEnumData):
+    """Enum for dimming control."""
+
+    TRIGGER_0 = False
+    TRIGGER = True
+
+
+class DPTTrigger(DPT1BitEnum[Trigger]):
+    """Abstraction for KNX 1-Bit trigger value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 17
+    value_type = "trigger"
+    data_type = Trigger
+
+    @classmethod
+    def _to_knx(cls, value: Trigger) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class Occupancy(DPTEnumData):
+    """Enum for dimming control."""
+
+    NOT_OCCUPIED = False
+    OCCUPIED = True
+
+
+class DPTOccupancy(DPT1BitEnum[Occupancy]):
+    """Abstraction for KNX 1-Bit occupancy value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 18
+    value_type = "occupancy"
+    data_type = Occupancy
+
+    @classmethod
+    def _to_knx(cls, value: Occupancy) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class WindowDoor(DPTEnumData):
+    """Enum for dimming control."""
+
+    CLOSED = False
+    OPEN = True
+
+
+class DPTWindowDoor(DPT1BitEnum[WindowDoor]):
+    """Abstraction for KNX 1-Bit window_door value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 19
+    value_type = "window_door"
+    data_type = WindowDoor
+
+    @classmethod
+    def _to_knx(cls, value: WindowDoor) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class LogicalFunction(DPTEnumData):
+    """Enum for dimming control."""
+
+    OR = False
+    AND = True
+
+
+class DPTLogicalFunction(DPT1BitEnum[LogicalFunction]):
+    """Abstraction for KNX 1-Bit logical_function value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 21
+    value_type = "logical_function"
+    data_type = LogicalFunction
+
+    @classmethod
+    def _to_knx(cls, value: LogicalFunction) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class SceneAB(DPTEnumData):
+    """Enum for dimming control."""
+
+    SCENE_A = False
+    SCENE_B = True
+
+
+class DPTSceneAB(DPT1BitEnum[SceneAB]):
+    """Abstraction for KNX 1-Bit scene_ab value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 22
+    value_type = "scene_ab"
+    data_type = SceneAB
+
+    @classmethod
+    def _to_knx(cls, value: SceneAB) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class ShutterBlindsMode(DPTEnumData):
+    """Enum for dimming control."""
+
+    UP_DOWN_MODE = False
+    STEP_STOP_MODE = True
+
+
+class DPTShutterBlindsMode(DPT1BitEnum[ShutterBlindsMode]):
+    """Abstraction for KNX 1-Bit shutter_blinds_mode value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 23
+    value_type = "shutter_blinds_mode"
+    data_type = ShutterBlindsMode
+
+    @classmethod
+    def _to_knx(cls, value: ShutterBlindsMode) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class DayNight(DPTEnumData):
+    """Enum for dimming control."""
+
+    DAY = False
+    NIGHT = True
+
+
+class DPTDayNight(DPT1BitEnum[DayNight]):
+    """Abstraction for KNX 1-Bit day_night value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 24
+    value_type = "day_night"
+    data_type = DayNight
+
+    @classmethod
+    def _to_knx(cls, value: DayNight) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
 class HeatCool(DPTEnumData):
     """Enum for heat/cool."""
 
@@ -72,11 +505,7 @@ class HeatCool(DPTEnumData):
 
 
 class DPTHeatCool(DPT1BitEnum[HeatCool]):
-    """
-    Abstraction for KNX 1-Bit heat/cool value.
-
-    DPT 1.100
-    """
+    """Abstraction for KNX 1-Bit heat/cool value."""
 
     dpt_main_number = 1
     dpt_sub_number = 100
@@ -87,3 +516,45 @@ class DPTHeatCool(DPT1BitEnum[HeatCool]):
     def _to_knx(cls, value: HeatCool) -> DPTBinary:
         """Return the raw KNX value for an Enum member."""
         return DPTBinary(value.value)
+
+
+class ConsumerProducer(DPTEnumData):
+    """Enum for dimming control."""
+
+    CONSUMER = False
+    PRODUCER = True
+
+
+class DPTConsumerProducer(DPT1BitEnum[ConsumerProducer]):
+    """Abstraction for KNX 1-Bit consumer_producer value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 1200
+    value_type = "consumer_producer"
+    data_type = ConsumerProducer
+
+    @classmethod
+    def _to_knx(cls, value: ConsumerProducer) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)
+
+
+class EnergyDirection(DPTEnumData):
+    """Enum for dimming control."""
+
+    POSITIVE = False
+    NEGATIVE = True
+
+
+class DPTEnergyDirection(DPT1BitEnum[EnergyDirection]):
+    """Abstraction for KNX 1-Bit energy_direction value."""
+
+    dpt_main_number = 1
+    dpt_sub_number = 1201
+    value_type = "energy_direction"
+    data_type = EnergyDirection
+
+    @classmethod
+    def _to_knx(cls, value: EnergyDirection) -> DPTBinary:
+        """Return the raw KNX value for an Enum member."""
+        return DPTBinary(value.value)


Test patch:
diff --git a/test/dpt_tests/dpt_1_test.py b/test/dpt_tests/dpt_1_test.py
index 6f4777c7..9adb8c6e 100644
--- a/test/dpt_tests/dpt_1_test.py
+++ b/test/dpt_tests/dpt_1_test.py
@@ -3,16 +3,96 @@
 import pytest
 
 from xknx.dpt import DPTArray, DPTBinary
-from xknx.dpt.dpt_1 import DPTHeatCool, DPTStep, DPTUpDown, HeatCool, Step, UpDown
+from xknx.dpt.dpt_1 import (
+    Ack,
+    Alarm,
+    BinaryValue,
+    Bool,
+    ConsumerProducer,
+    DayNight,
+    DimSendStyle,
+    DPTAck,
+    DPTAlarm,
+    DPTBinaryValue,
+    DPTBool,
+    DPTConsumerProducer,
+    DPTDayNight,
+    DPTDimSendStyle,
+    DPTEnable,
+    DPTEnergyDirection,
+    DPTHeatCool,
+    DPTInputSource,
+    DPTInvert,
+    DPTLogicalFunction,
+    DPTOccupancy,
+    DPTOpenClose,
+    DPTRamp,
+    DPTReset,
+    DPTSceneAB,
+    DPTShutterBlindsMode,
+    DPTStart,
+    DPTState,
+    DPTStep,
+    DPTSwitch,
+    DPTTrigger,
+    DPTUpDown,
+    DPTWindowDoor,
+    Enable,
+    EnergyDirection,
+    HeatCool,
+    InputSource,
+    Invert,
+    LogicalFunction,
+    Occupancy,
+    OpenClose,
+    Ramp,
+    Reset,
+    SceneAB,
+    ShutterBlindsMode,
+    Start,
+    State,
+    Step,
+    Switch,
+    Trigger,
+    UpDown,
+    WindowDoor,
+)
 from xknx.exceptions import ConversionError, CouldNotParseTelegram
 
 
 @pytest.mark.parametrize(
     ("dpt", "value_false", "value_true"),
     [
+        (DPTSwitch, Switch.OFF, Switch.ON),
+        (DPTBool, Bool.FALSE, Bool.TRUE),
+        (DPTEnable, Enable.DISABLE, Enable.ENABLE),
+        (DPTRamp, Ramp.NO_RAMP, Ramp.RAMP),
+        (DPTAlarm, Alarm.NO_ALARM, Alarm.ALARM),
+        (DPTBinaryValue, BinaryValue.LOW, BinaryValue.HIGH),
         (DPTStep, Step.DECREASE, Step.INCREASE),
         (DPTUpDown, UpDown.UP, UpDown.DOWN),
+        (DPTOpenClose, OpenClose.OPEN, OpenClose.CLOSE),
+        (DPTStart, Start.STOP, Start.START),
+        (DPTState, State.INACTIVE, State.ACTIVE),
+        (DPTInvert, Invert.NOT_INVERTED, Invert.INVERTED),
+        (DPTDimSendStyle, DimSendStyle.START_STOP, DimSendStyle.CYCLICALLY),
+        (DPTInputSource, InputSource.FIXED, InputSource.CALCULATED),
+        (DPTReset, Reset.NO_ACTION, Reset.RESET),
+        (DPTAck, Ack.NO_ACTION, Ack.ACKNOWLEDGE),
+        (DPTTrigger, Trigger.TRIGGER_0, Trigger.TRIGGER),
+        (DPTOccupancy, Occupancy.NOT_OCCUPIED, Occupancy.OCCUPIED),
+        (DPTWindowDoor, WindowDoor.CLOSED, WindowDoor.OPEN),
+        (DPTLogicalFunction, LogicalFunction.OR, LogicalFunction.AND),
+        (DPTSceneAB, SceneAB.SCENE_A, SceneAB.SCENE_B),
+        (
+            DPTShutterBlindsMode,
+            ShutterBlindsMode.UP_DOWN_MODE,
+            ShutterBlindsMode.STEP_STOP_MODE,
+        ),
+        (DPTDayNight, DayNight.DAY, DayNight.NIGHT),
         (DPTHeatCool, HeatCool.COOL, HeatCool.HEAT),
+        (DPTConsumerProducer, ConsumerProducer.CONSUMER, ConsumerProducer.PRODUCER),
+        (DPTEnergyDirection, EnergyDirection.POSITIVE, EnergyDirection.NEGATIVE),
     ],
 )
 class TestDPT1:
diff --git a/test/dpt_tests/dpt_lookup_test.py b/test/dpt_tests/dpt_lookup_test.py
index dec8066c..97475978 100644
--- a/test/dpt_tests/dpt_lookup_test.py
+++ b/test/dpt_tests/dpt_lookup_test.py
@@ -10,6 +10,8 @@ from xknx.dpt import *
 # Run this function manually to update the list.
 # """
 
+# from xknx.dpt import DPTBase
+
 # dpt_dict = {}
 # for dpt in DPTBase.dpt_class_tree():
 #     if dpt.value_type is not None:
@@ -39,12 +41,14 @@ from xknx.dpt import *
         ("absolute_temperature", DPTAbsoluteTemperature, 14, 69, "K"),
         ("acceleration", DPTAcceleration, 14, 0, "m/s²"),
         ("acceleration_angular", DPTAccelerationAngular, 14, 1, "rad/s²"),
+        ("ack", DPTAck, 1, 16, None),
         ("activation_energy", DPTActivationEnergy, 14, 2, "J/mol"),
         ("active_energy", DPTActiveEnergy, 13, 10, "Wh"),
         ("active_energy_kwh", DPTActiveEnergykWh, 13, 13, "kWh"),
         ("active_energy_mwh", DPTActiveEnergyMWh, 13, 16, "MWh"),
         ("activity", DPTActivity, 14, 3, "s⁻¹"),
         ("air_flow", DPTAirFlow, 9, 9, "m³/h"),
+        ("alarm", DPTAlarm, 1, 5, None),
         ("amplitude", DPTAmplitude, 14, 5, None),
         ("angle", DPTAngle, 5, 3, "°"),
         ("angle_deg", DPTAngleDeg, 14, 7, "°"),
@@ -56,6 +60,8 @@ from xknx.dpt import *
         ("apparant_energy_kvah", DPTApparantEnergykVAh, 13, 14, "kVAh"),
         ("apparent_power", DPTApparentPower, 14, 80, "VA"),
         ("area", DPTArea, 14, 10, "m²"),
+        ("binary_value", DPTBinaryValue, 1, 6, None),
+        ("bool", DPTBool, 1, 2, None),
         ("brightness", DPTBrightness, 7, 13, "lx"),
         ("capacitance", DPTCapacitance, 14, 11, "F"),
         ("charge_density_surface", DPTChargeDensitySurface, 14, 12, "C/m²"),
@@ -68,11 +74,15 @@ from xknx.dpt import *
         ("compressibility", DPTCompressibility, 14, 14, "m²/N"),
         ("concentration_ugm3", DPTConcentrationUGM3, 9, 30, "μg/m³"),
         ("conductance", DPTConductance, 14, 15, "S"),
+        ("consumer_producer", DPTConsumerProducer, 1, 1200, None),
         ("control_blinds", DPTControlBlinds, 3, 8, None),
         ("control_dimming", DPTControlDimming, 3, 7, None),
         ("counter_pulses", DPTValue1Count, 6, 10, "counter pulses"),
         ("curr", DPTCurrent, 9, 21, "mA"),
         ("current", DPTUElCurrentmA, 7, 12, "mA"),
+        ("date", DPTDate, 11, 1, None),
+        ("datetime", DPTDateTime, 19, 1, None),
+        ("day_night", DPTDayNight, 1, 24, None),
         ("decimal_factor", DPTDecimalFactor, 5, 5, None),
         ("delta_time_100ms", DPTDeltaTime100Msec, 8, 4, "ms"),
         ("delta_time_10ms", DPTDeltaTime10Msec, 8, 3, "ms"),
@@ -81,6 +91,7 @@ from xknx.dpt import *
         ("delta_time_ms", DPTDeltaTimeMsec, 8, 2, "ms"),
         ("delta_time_sec", DPTDeltaTimeSec, 8, 5, "s"),
         ("density", DPTDensity, 14, 17, "kg/m³"),
+        ("dim_send_style", DPTDimSendStyle, 1, 13, None),
         ("electric_charge", DPTElectricCharge, 14, 18, "C"),
         ("electric_current", DPTElectricCurrent, 14, 19, "A"),
         ("electric_current_density", DPTElectricCurrentDensity, 14, 20, "A/m²"),
@@ -95,7 +106,9 @@ from xknx.dpt import *
         ("electrical_conductivity", DPTElectricalConductivity, 14, 16, "S/m"),
         ("electromagnetic_moment", DPTElectromagneticMoment, 14, 29, "A m²"),
         ("electromotive_force", DPTElectromotiveForce, 14, 30, "V"),
+        ("enable", DPTEnable, 1, 3, None),
         ("energy", DPTEnergy, 14, 31, "J"),
+        ("energy_direction", DPTEnergyDirection, 1, 1201, None),
         ("enthalpy", DPTEnthalpy, 9, 60000, "H"),
         ("flow_rate_m3h", DPTFlowRateM3H, 13, 2, "m³/h"),
         ("force", DPTForce, 14, 32, "N"),
@@ -110,12 +123,15 @@ from xknx.dpt import *
         ("hvac_status", DPTHVACStatus, 20, 60102, None),
         ("illuminance", DPTLux, 9, 4, "lx"),
         ("impedance", DPTImpedance, 14, 38, "Ω"),
+        ("input_source", DPTInputSource, 1, 14, None),
+        ("invert", DPTInvert, 1, 12, None),
         ("kelvin_per_percent", DPTKelvinPerPercent, 9, 23, "K/%"),
         ("latin_1", DPTLatin1, 16, 1, None),
         ("length", DPTLength, 14, 39, "m"),
         ("length_m", DPTLengthM, 8, 12, "m"),
         ("length_mm", DPTLengthMm, 7, 11, "mm"),
         ("light_quantity", DPTLightQuantity, 14, 40, "lm s"),
+        ("logical_function", DPTLogicalFunction, 1, 21, None),
         ("long_delta_timesec", DPTLongDeltaTimeSec, 13, 100, "s"),
         ("long_time_period_hrs", DPTLongTimePeriodHrs, 12, 102, "h"),
         ("long_time_period_min", DPTLongTimePeriodMin, 12, 101, "min"),
@@ -134,6 +150,8 @@ from xknx.dpt import *
         ("mass_flux", DPTMassFlux, 14, 52, "kg/s"),
         ("mol", DPTMol, 14, 4, "mol"),
         ("momentum", DPTMomentum, 14, 53, "N/s"),
+        ("occupancy", DPTOccupancy, 1, 18, None),
+        ("open_close", DPTOpenClose, 1, 9, None),
         ("percent", DPTScaling, 5, 1, "%"),
         ("percentU8", DPTPercentU8, 5, 4, "%"),
         ("percentV16", DPTPercentV16, 8, 10, "%"),
@@ -154,22 +172,29 @@ from xknx.dpt import *
         ("pulse_4_ucount", DPTValue4Ucount, 12, 1, "counter pulses"),
         ("pulse_4byte", DPTValue4Count, 13, 1, "counter pulses"),
         ("rain_amount", DPTRainAmount, 9, 26, "L/m²"),
+        ("ramp", DPTRamp, 1, 4, None),
         ("reactance", DPTReactance, 14, 59, "Ω"),
         ("reactive_energy", DPTReactiveEnergy, 13, 12, "VARh"),
         ("reactive_energy_kvarh", DPTReactiveEnergykVARh, 13, 15, "kVARh"),
+        ("reset", DPTReset, 1, 15, None),
         ("resistance", DPTResistance, 14, 60, "Ω"),
         ("resistivity", DPTResistivity, 14, 61, "Ωm"),
         ("rotation_angle", DPTRotationAngle, 8, 11, "°"),
+        ("scene_ab", DPTSceneAB, 1, 22, None),
         ("scene_control", DPTSceneControl, 18, 1, None),
         ("scene_number", DPTSceneNumber, 17, 1, None),
         ("self_inductance", DPTSelfInductance, 14, 62, "H"),
+        ("shutter_blinds_mode", DPTShutterBlindsMode, 1, 23, None),
         ("solid_angle", DPTSolidAngle, 14, 63, "sr"),
         ("sound_intensity", DPTSoundIntensity, 14, 64, "W/m²"),
         ("speed", DPTSpeed, 14, 65, "m/s"),
+        ("start", DPTStart, 1, 10, None),
+        ("state", DPTState, 1, 11, None),
         ("step", DPTStep, 1, 7, None),
         ("stress", DPTStress, 14, 66, "Pa"),
         ("string", DPTString, 16, 0, None),
         ("surface_tension", DPTSurfaceTension, 14, 67, "N/m"),
+        ("switch", DPTSwitch, 1, 1, None),
         ("tariff", DPTTariff, 5, 6, None),
         ("tariff_active_energy", DPTTariffActiveEnergy, 235, 1, None),
         ("temperature", DPTTemperature, 9, 1, "°C"),
@@ -180,6 +205,7 @@ from xknx.dpt import *
         ("thermal_capacity", DPTThermalCapacity, 14, 71, "J/K"),
         ("thermal_conductivity", DPTThermalConductivity, 14, 72, "W/mK"),
         ("thermoelectric_power", DPTThermoelectricPower, 14, 73, "V/K"),
+        ("time", DPTTime, 10, 1, None),
         ("time_1", DPTTime1, 9, 10, "s"),
         ("time_2", DPTTime2, 9, 11, "ms"),
         ("time_period_100msec", DPTTimePeriod100Msec, 7, 4, "ms"),
@@ -190,6 +216,7 @@ from xknx.dpt import *
         ("time_period_sec", DPTTimePeriodSec, 7, 5, "s"),
         ("time_seconds", DPTTimeSeconds, 14, 74, "s"),
         ("torque", DPTTorque, 14, 75, "Nm"),
+        ("trigger", DPTTrigger, 1, 17, None),
         ("up_down", DPTUpDown, 1, 8, None),
         ("voltage", DPTVoltage, 9, 20, "mV"),
         ("volume", DPTVolume, 14, 76, "m³"),
@@ -200,6 +227,7 @@ from xknx.dpt import *
         ("weight", DPTWeight, 14, 78, "N"),
         ("wind_speed_kmh", DPTWspKmh, 9, 28, "km/h"),
         ("wind_speed_ms", DPTWsp, 9, 5, "m/s"),
+        ("window_door", DPTWindowDoor, 1, 19, None),
         ("work", DPTWork, 14, 79, "J"),
     ],
 )