Skip to content

3.0.0 Eager telegram decoding, DPTComplex and DPTEnum

Compare
Choose a tag to compare
@farmio farmio released this 31 Jul 05:22
· 31 commits to main since this release

Breaking changes

  • Drop support for Python 3.9
  • Change callback signatures from awaitable to callable in XKNX.device_updated_cb, TelegramQueue, Device, Devices, ConnectionManager and RemoteValue.
  • Remove async from functions / methods (nothing has to be awaited there)
    • Tools: group_value_write, group_value_response and group_value_read
    • ConnectionManager: .connection_state_changed
    • Device: .process, .process_group_write, .process_group_read, .process_group_response
    • Devices: .process
    • RemoteValue: .set, .respond, .process and .update_value
    • ValueReader: .send_group_read
  • Rename DPT transcoder modules for schema xknx.dpt.dpt_<main-number>.py

Bugfixes

  • Fix value scaling for sensor types: time_period_100msec, time_period_10msec, delta_time_10ms, delta_time_100ms, percentV16

Features

  • Added eager telegram data decoding for GroupValueWrite / GroupValueResponse Telegrams. DPTs for group addresses can be set using xknx.group_address_dpt.set(). Telegram has a new attribute decoded_data which is set when a decoder was found.

Devices

  • A Device doesn't auto-add to xknx.devices anymore. It can be done via xknx.devices.async_add() now. xknx.devices.async_remove stops a device from processing telegrams, removes from StateUpdater and cancels its internal tasks. Removed devices can be added again.
  • Device.shutdown method is removed
  • Refactor ClimateMode device
  • Rename ClimateMode argument group_address_operation_mode_night to group_address_operation_mode_economy
  • Remove DPT 3 special handling stepwise_* and startstop_* from Sensor device
  • Remove DateTime device in favour of DateDevice, TimeDevice and DateTimeDevice using datetime objects instead of time.struct_time

DPT

  • DPTComplex: Common interface for DPT transcoders with multi-value data. Resulting dataclasses can be converted to and from a dict with DPT specific properties to be JSON compatible.
  • Added or refactored complex DPTs and dataclasses:
    • 3.007 - DPTControlDimming
    • 3.008 - DPTControlBlinds
    • 10.001 - DPTTime - KNXTime
    • 11.001 - DPTDate - KNXDate
    • 18.001 - DPTSceneControl
    • 19.001 - DPTDateTime - KNXDateTime
    • 232.600 - DPTColorRGB - RGBColor
    • 235.001 - DPTTariffActiveEnergy - TariffActiveEnergy
    • 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.
    • 1.007 - DPTStep
    • 1.008 - DPTUpDown
    • 1.100 - DPTHeatCool
    • 20.102 - DPTHVACMode - HVACOperationMode
      • rename "NIGHT" to "ECONOMY" and "FROST_PROTECTION" to "BUILDING_PROTECTION" according to KNX specifications
    • 20.105 - DPTHVACContrMode - HVACControllerMode
      • rename "DRY" to "DEHUMIDIFICATION" and add some values according to KNX specifications
  • Change DPT number of Enthalpy from 9.999 to 9.60000 (manufacturer specific range)
  • Support dict values with "main" and "sub" keys for DPTBase.parse_transcoder()
  • Verify DPTBinary max payload bitsize when decoding by transcoders payload_length

Address

  • InternalGroupAddress attribute address is renamed to raw to be in line with GroupAddress (although still str). Its value has an "i-" prefix.

Internal

  • Use slots in addresses, Telegram, DPTBinary, DPTArray, TPCI, APCI, DPTComplexData
  • Convert Telegram and APCI to dataclasses. Telegram is not hashable anymore.
  • RemoteValue instances use pre-decoded data from Telegrams if available and dpt_class for is set - otherwise they decode the data themselves in from_knx like before.
  • Remove RemoteValueControl and unused RemoteValue1Count class
  • Add value argument to RemoteValue after_update_cb callback