Digital-Alchemy-TS / synapse

Typescript utilities for creating and managing virtual entities within Home Assistant
https://docs.digital-alchemy.app
MIT License
1 stars 0 forks source link

Sensor state class doesn't accept strings #28

Closed zoe-codez closed 2 months ago

zoe-codez commented 3 months ago

🪤 Context

This only accepts the enum, it should also accept the correct strings via a string union. Quick tweak

synapse.sensor({
  // ...
  state_class: SensorStateClass.TOTAL,
});
zoe-codez commented 3 months ago

Mental note: It was set up this way originally because there is docs on the enum. Those details should be moved to the state_class property to have a centralized spot