dummylabs / thewatchman

Home Assistant custom integration to keep track of missing entities and actions in your config files
MIT License
475 stars 20 forks source link

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

Closed chemelli74 closed 1 day ago

chemelli74 commented 6 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 6 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 4 months 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 4 months 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 4 months 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.

dummylabs commented 2 days ago

I'm considering adding folders like custom_components and blueprints to the exclusions list by default, as they were not initially intended to be monitored by Watchman, given they are not part of the user configuration.

Hiekkaharju commented 2 days ago

I'm considering adding folders like custom_components and blueprints to the exclusions list by default, as they were not initially intended to be monitored by Watchman, given they are not part of the user configuration.

Sounds good. In that case, please consider excluding also "esphome" folder, which is is created to "config" by the esphome add-on (not by the integration). While it contains user configuraton yaml, it is for esphome devices, not for HA.

dummylabs commented 1 day ago

consider excluding also "esphome" folder

I've also thought about the esphome folder. To be honest, it's hard to categorize it definitively as either user configuration or third-party extension files.

dummylabs commented 1 day ago

Following items will be set as default ignored files for new installations of Watchman 0.6.4 */blueprints/*, */custom_components/*, */esphome/*