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

Typing improvements & tests #31

Closed zoe-codez closed 1 month ago

zoe-codez commented 2 months ago

📬 Changes

const sensor = synapse.sensor<{
  state: number;
  attributes: { 
    exampleBool: boolean;
  };
  locals: {
    stringProperty: string;
    objectProperty: Record<string, unknown>;
  }
}>({ context, ... })

Everything will have attributes and locals available, and a few domains will 3rd property. state for sensor, options for select, etc (building out of more domains in the future, only sensor atm)

Docs link with examples for locals:

https://docs.digital-alchemy.app/docs/home-automation/synapse/locals

🗒️ Checklist

codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 83.80%. Comparing base (5cb6a66) to head (d3b3c71).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #31 +/- ## =========================================== + Coverage 64.90% 83.80% +18.89% =========================================== Files 46 46 Lines 644 636 -8 Branches 64 62 -2 =========================================== + Hits 418 533 +115 + Misses 222 103 -119 + Partials 4 0 -4 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.