Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow optional channel type #419

Merged

Conversation

JHK
Copy link
Contributor

@JHK JHK commented Sep 22, 2023

A small fix for the type system. It seems there are things having channels without a channelTypeUID.

Here a brief snippet from my configuration:

  {
    "channels": [
      {
        "linkedItems": [
          "RoofTop_Stairwell_Shutter"
        ],
        "uid": "somfytahoma:rollershutter:48ca8db4:3d816fbc-d9b5-4d52-883f-34c5744e3974:control",
        "id": "control",
        "channelTypeUID": "somfytahoma:control",
        "itemType": "Rollershutter",
        "kind": "STATE",
        "label": "Control",
        "description": "Device control (UP, DOWN, MY/STOP, closure 0-100%)",
        "defaultTags": [],
        "properties": {},
        "configuration": {}
      },
      {
        "linkedItems": [],
        "uid": "somfytahoma:rollershutter:48ca8db4:3d816fbc-d9b5-4d52-883f-34c5744e3974:rssi",
        "id": "rssi",
        "itemType": "Number",
        "kind": "STATE",
        "label": "RSSI Level",
        "defaultTags": [],
        "properties": {},
        "configuration": {}
      }
    ],
    "statusInfo": {
      "status": "ONLINE",
      "statusDetail": "NONE"
    },
    "editable": true,
    "label": "Homecontrol: Treppenhaus",
    "bridgeUID": "somfytahoma:bridge:48ca8db4",
    "configuration": {
      "url": "io://0817-5347-9274/4909609"
    },
    "properties": {
      "core:Memorized1PositionState": "0.0",
      "core:StatusState": "available",
      "core:ClosureState": "100.0",
      "core:NameState": "Treppenhaus",
      "label": "Treppenhaus",
      "core:OpenClosedState": "closed",
      "core:CommandLockLevelsState": "[]",
      "io:PriorityLockLevelState": "java.lang.Object@1e2c656",
      "core:PriorityLockTimerState": "0.0",
      "core:DiscreteRSSILevelState": "normal",
      "io:PriorityLockOriginatorState": "java.lang.Object@55ef8c",
      "core:RSSILevelState": "52.0"
    },
    "UID": "somfytahoma:rollershutter:48ca8db4:3d816fbc-d9b5-4d52-883f-34c5744e3974",
    "thingTypeUID": "somfytahoma:rollershutter"
  }

addressing the error I got on startup:

Error Object missing required field `channelTypeUID` - at `$[4].channels[1]` in on_connected:
File "$HOME/Code/homeautomation/habapp/lib/python3.11/site-packages/HABApp/openhab/connection/plugins/load_items.py", line 30 in on_connected
...

@spacemanspiff2007 spacemanspiff2007 merged commit fb9cb5b into spacemanspiff2007:master Sep 24, 2023
@spacemanspiff2007
Copy link
Owner

Thank you for your contribution

@JHK JHK deleted the undefined-channel-types branch September 25, 2023 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants