updated the component and device api's to have as be a parameter for the function
This commit is contained in:
parent
c617ebf868
commit
b62c7dbe5c
39 changed files with 346 additions and 651 deletions
|
|
@ -120,7 +120,7 @@ export default function ComponentCard(props: Props) {
|
|||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
const [sensors, setSensors] = useState<Sensor[]>([]);
|
||||
const [{ user, showErrors }] = useGlobalState();
|
||||
const [{ user, showErrors, as }] = useGlobalState();
|
||||
|
||||
const updateControllerState = (checked: boolean) => {
|
||||
let updatedComponent = cloneDeep(component);
|
||||
|
|
@ -130,7 +130,7 @@ export default function ComponentCard(props: Props) {
|
|||
let describe = controllerModeLabel(newMode);
|
||||
|
||||
componentAPI
|
||||
.update(device.id(), updatedComponent.settings)
|
||||
.update(device.id(), updatedComponent.settings, undefined, undefined, as)
|
||||
.then(() => {
|
||||
success(component.name() + "'s mode was set to " + describe);
|
||||
refreshCallback(updatedComponent);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue