fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
553 stars 101 forks source link

hw_version in core.device_registry #565

Open garry0garry opened 1 year ago

garry0garry commented 1 year ago

Describe the bug hw_version is always null for all my Reolink cameras.

To Reproduce {% set list = namespace(id=[]) %} {% for state in states.camera %} {% if device_attr(state.entity_id, 'id') != None %} {% set list.id = list.id + [device_attr(state.entity_id, 'id')] %} {% endif %} {% endfor %} {% set u_list = (list.id|unique|list) %} {% set data = namespace(hw_version=[]) %} {% for state in u_list %} {% set data.hw_version = data.hw_version + [device_attr(state, 'hw_version')] %} {% endfor %} {{data.hw_version}}

Environment:

garry0garry commented 1 year ago
core.device_registry:
      {
        "config_entries": [
          "ebff46a797226758ed863f8646a61b40",
          "479ae44c974fcfcd62c1c328926629e6"
        ],
        "connections": [
          [
            "mac",
            "ec:71:db:cd:4e:c0"
          ]
        ],
        "identifiers": [
          [
            "reolink_dev",
            "ec71dbcd4ec0-1"
          ]
        ],
        "manufacturer": "Reolink",
        "model": "RLC-520A",
        "name": "cam2",
        "sw_version": "v3.1.0.951_22041566",
        "hw_version": null,
        "entry_type": null,
        "id": "6f581d56b0976c8b28b1a63c2bb856f1",
        "via_device_id": null,
        "area_id": "kamennyi_sarai",
        "name_by_user": null,
        "disabled_by": null,
        "configuration_url": null
      },
mnpg commented 1 year ago

Another proof that the reolink api isn't reliable. They change the api when they want, it's different from a firmware version to another. We, developpers, aren't inform what's new AND what are the changes. Just blame Reolink, they are not help us.

garry0garry commented 1 year ago

What is Reolink's fault? Here is the integration code:


        """Information about this entity/device."""
        return {
            "identifiers": {(DOMAIN, self._base.unique_id)},
            "connections": {(CONNECTION_NETWORK_MAC, self._base.api.mac_address)},
            "name": self._base.name,
            "sw_version": self._base.api.sw_version,
            "model": self._base.api.model,
            "manufacturer": self._base.api.manufacturer,
            "channel": self._base.channel,

Where is hw_version?