4
0

catalog.py 693 B

1234567891011121314151617181920212223242526
  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. for entity in device.all_entities():
  17. print(f"{config}: {entity.config_id}")
  18. if __name__ == "__main__":
  19. sys.exit(main())