Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ha-lovelace-ts

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ha-lovelace-ts

TypeScript-based tool for building Home Assistant Lovelace Interfaces

  • 0.3.6
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

lovelace_ts - HA Lovelace Config as TypeScript

Usage

  1. Setup a Node devenv - make sure you have nodejs and yarn installed, create a directory, run yarn init and yarn add ha-lovelace-ts
  2. Setup your tsconfig.json file with at least these parameters:
    {
        "compilerOptions": {
            "rootDir": ".",
    
            "jsx": "react",
            "jsxFactory": "h",
            "jsxFragmentFactory": "Fragment",
        },
    }
    
  3. Create an index.tsx file and start writing your UI. Here's an example:
    import { render, h } from 'ha-lovelace-ts'
    
    async function Blah() {
        return <area area='Blah' />
    }
    
    export default render(<dashboard title='Robert'>
        <view title='Hia' path='phil' type="masonry">
            <horizontal_stack>
                <entities entities={['a', 'b']} />
            </horizontal_stack>
        </view>
        <view title='Hia' path='phil'>
            <Blah />
        </view>
    </dashboard>)
    
  4. Compile - run yarn lovelace_ts build index.tsx output.yml
  5. Copy the generated file to your HA instance

Contributing Card Definitions

Take a look at src/contrib and look at the existing definitions as examples.

FAQs

Package last updated on 02 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc