catalog.py 761 B

123456789101112131415161718192021222324252627
  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 (
  9. TuyaDeviceConfig,
  10. available_configs,
  11. )
  12. def main() -> int:
  13. print("Catalog================")
  14. for config in available_configs():
  15. device = TuyaDeviceConfig(config)
  16. print(f"{config}: {device.primary_entity.config_id}")
  17. for entity in device.secondary_entities():
  18. print(f"{config}: {entity.config_id}")
  19. if __name__ == "__main__":
  20. sys.exit(main())