catalog.py 745 B

123456789101112131415161718192021
  1. #!/usr/bin/python3
  2. """Build a catalog of supported devices/entities
  3. This script was created to check for entity ids that change between versions.
  4. The script needs to be run on the version before a potential id changing
  5. modification, then again after to compare the two outputs.
  6. """
  7. import sys
  8. from custom_components.tuya_local.helpers.device_config import available_configs, TuyaDeviceConfig
  9. def main() -> int:
  10. print("Catalog================")
  11. for config in available_configs():
  12. device = TuyaDeviceConfig(config)
  13. print(f"{config}: {device.primary_entity.config_id}")
  14. for entity in device.secondary_entities():
  15. print(f"{config}: {entity.config_id}")
  16. if __name__ == "__main__":
  17. sys.exit(main())