Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
filtered = log.filter(l => {
if (filter && filter.includes(':')) {
let [searchString, value] = filter.split(':')
if (!searchString.startsWith('body')) searchString = `body.${searchString}`
console.log(l, searchString, value)
return get(l, searchString) === value
}
return true
})
}
render(props, {}) {
const boxData = get(props, `${DASHBOARD_BOX_DATA_KEY}TemperatureInRoom.${props.x}_${props.y}`);
const boxStatus = get(props, `${DASHBOARD_BOX_STATUS_KEY}TemperatureInRoom.${props.x}_${props.y}`);
const temperature = get(boxData, 'room.temperature.temperature');
const unit = get(boxData, 'room.temperature.unit');
const roomName = get(boxData, 'room.name');
return (
);
}
}
refreshDeviceProperty = () => {
if (!this.props.device.features) {
return null;
}
const batteryLevelDeviceFeature = this.props.device.features.find(
deviceFeature => deviceFeature.category === DEVICE_FEATURE_CATEGORIES.BATTERY
);
const batteryLevel = get(batteryLevelDeviceFeature, 'last_value');
this.setState({
batteryLevel
});
};
saveDevice = async () => {
)}
)}
<div class="form-group">
<label class="form-label">
</label>
<input id="profile.passwordPlaceholder" placeholder="{<Text" value="{props.newUser.password}" class="{cx('form-control'," type="password">}
/>
<div class="invalid-feedback">
</div>
</div>
<div class="form-group">
<label class="form-label">
</label>
</div>
const resolutions = keys(schema).map((key): Promise => (
validate(get(object, key), schema[key]).then((message) => {
errors[key] = message;
})
));
return Promise.all(resolutions).then(() => errors);
placeholder={
<div class="page-options d-flex">
<button class="btn btn-info">
</button>
</div>
<div class="card-body">
<div class="{cx('dimmer',">
<div class="loader">
<div class="dimmer-content">
{get(props, 'zwaveStatus.ready') && (
<div class="alert alert-success">
</div>
)}
{!get(props, 'zwaveStatus.ready') && (
<div class="alert alert-warning">
</div>
)}
{props.zwaveConnectionInProgress && (
<div class="alert alert-info">
</div>
)}
{props.zwaveDriverFailed && (
<div class="alert alert-danger"></div></div></div></div></div>
async getBoxes(state) {
store.setState({
DashboardGetBoxesStatus: RequestStatus.Getting
});
try {
const homeDashboard = await state.httpClient.get('/api/v1/dashboard/home');
store.setState({
gatewayInstanceNotFound: false,
homeDashboard,
DashboardGetBoxesStatus: RequestStatus.Success
});
} catch (e) {
const status = get(e, 'response.status');
const errorMessage = get(e, 'response.error_message');
if (status === 404 && errorMessage === 'NO_INSTANCE_FOUND') {
store.setState({
gatewayInstanceNotFound: true
});
} else if (status === 404) {
store.setState({
dashboardNotConfigured: true,
homeDashboard: EMPTY_DASHBOARD
});
} else {
store.setState({
DashboardGetBoxesStatus: RequestStatus.Error
});
}
}
deviceFeatureWebsocketEvent(state, x, y, payload) {
const data = boxActions.getBoxData(state, BOX_KEY, x, y);
const devices = get(data, 'room.devices');
if (devices) {
let found = false;
let currentDeviceIndex = 0;
let currentFeatureIndex = 0;
while (!found && currentDeviceIndex < devices.length) {
while (!found && currentFeatureIndex < devices[currentDeviceIndex].features.length) {
if (
devices[currentDeviceIndex].features[currentFeatureIndex].selector === payload.device_feature_selector
) {
found = true;
const newData = update(data, {
room: {
devices: {
[currentDeviceIndex]: {
features: {
[currentFeatureIndex]: {
render(props, {}) {
const boxData = get(props, `${DASHBOARD_BOX_DATA_KEY}Camera.${props.x}_${props.y}`);
const boxStatus = get(props, `${DASHBOARD_BOX_STATUS_KEY}Camera.${props.x}_${props.y}`);
const image = get(boxData, 'image');
const error = boxStatus === RequestStatus.Error;
return ;
}
}