dummylabs / thewatchman

Home Assistant custom integration to keep track of missing entities and services in your config files
MIT License
429 stars 18 forks source link

Consider supported_features and example in services.yaml as valid #130

Open chemelli74 opened 2 months ago

chemelli74 commented 2 months ago

In services.yaml, integrations can specify a supported_features key to filter entities. Here an example:

backup:
  name: Backup
  description: Backup the ESPSomfy Device
  target:
    entity:
      integration: espsomfy_rts
      domain: button
      supported_features:
        - fan.FanEntityFeature.OSCILLATE

Here the documentation reference: Filtering service fields

chemelli74 commented 2 months ago

Same goes for the example key:

replace_sensor:
  description: Replaces an external sensor
  # target:
  #   entity:
  #     domain: plant
  fields:
    meter_entity:
      name: Meter entity
      description: The meter entity to replace the sensor for
      example: plant.my_plant_current_temperature
      required: true
      selector:
        entity:
          domain: sensor
          integration: plant
dummylabs commented 3 days ago

Hey @chemelli74, Watchman was not designed to look after custom integration files. Yes, they have yaml format, but they can carry nearly anything. How often do you change them?

chemelli74 commented 3 days ago

Hi,

Thx for the feedback.

Those data comes as examples from some integrations; I don't change them.

But I think they should be excluded by the code logic of watchman. Or at least been part of the default exclusion list so that they don't counts toward the missing entities/services.

Hiekkaharju commented 3 days ago

Agree with chemell74. Yes, they can carry nearly anything, but now we are talking about a couple of specific field names in them. And these appear to be "known" by home assistant. I did not now find the proper documentation about these, but here is a HA tutorial page with "example:" in it. https://developers.home-assistant.io/docs/dev_101_services ref also #56

edit: adding that all "example:" fields I've seen are single liners, thus they would go with those few extra characters I suggested in #56. The multiline fields, like "supported_features:" require a bit more code.