Components

ToggleSwitchItem

<ToggleSwitchItem url type />

Constructor

# <ToggleSwitchItem url type />

This component is just a container used to hold any ToggleSwitch sensor item. It is responsible for making periodic calls to fetch the current state of the sensor to be displayed in the dashboard. It relies on useFetch and useInterval hooks.

PropTypes:
Name Type Required Description Default
url string Yes The endpoint to fetch the current switch state from.
type enum Yes The type of switch it is. It must be one of onOff, openClose or motionDetected.

View Source components/dashboard/ToggleSwitchItem.jsx, line 19

<ToggleSwitchItem />