keatontaylor / alexa-actions

A README and associated code to get actionable notifications setup for Alexa devices.
GNU General Public License v3.0
399 stars 187 forks source link

Use pydantic for ha state management. Should make code more readable #149

Closed DEADSEC-SECURITY closed 1 year ago

DEADSEC-SECURITY commented 1 year ago

Make all ha_state definitions use pydantic objects instead of json objects.

This should make the code more readable and better to debug since a static template would be used for states across the class.

Ideas: Use 2 models for ha_state

  1. For error state (error and text tag)
  2. For normal state (extra context).
DEADSEC-SECURITY commented 1 year ago

decode response could also return a object instead of json.