Compare commits
4 Commits
deploy---2
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 8ded5e6c7d | |||
| eb99652e76 | |||
| ac750e9515 | |||
| 0111036617 |
@ -54,9 +54,12 @@ export class PropertyListComponent implements OnInit {
|
||||
}
|
||||
|
||||
private updateProperty(property: Property, existing: boolean): void {
|
||||
if (property.type === PropertyType.BOOLEAN) {
|
||||
this.updateProperty2(this.booleans, property, existing);
|
||||
} else if (property.type === PropertyType.SHUTTER) {
|
||||
this.updateProperty2(this.shutters, property, existing);
|
||||
}
|
||||
}
|
||||
|
||||
private updateProperty2(properties: Property[], property: Property, existing: boolean) {
|
||||
const index: number = properties.findIndex(p => p.id === property.id);
|
||||
|
||||
@ -0,0 +1,20 @@
|
||||
package de.ph87.homeautomation.knx.group;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@RequestMapping("knx/group")
|
||||
public class KnxGroupImportController {
|
||||
|
||||
private final KnxGroupImportService knxGroupImportService;
|
||||
|
||||
@GetMapping("import")
|
||||
public void doImport() {
|
||||
knxGroupImportService.importGroups();
|
||||
}
|
||||
|
||||
}
|
||||
@ -4,10 +4,7 @@ import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import tuwien.auto.calimero.GroupAddress;
|
||||
import tuwien.auto.calimero.KNXException;
|
||||
import tuwien.auto.calimero.KNXFormatException;
|
||||
import tuwien.auto.calimero.KNXTimeoutException;
|
||||
import tuwien.auto.calimero.*;
|
||||
import tuwien.auto.calimero.datapoint.StateDP;
|
||||
import tuwien.auto.calimero.dptxlator.TranslatorTypes;
|
||||
import tuwien.auto.calimero.process.ProcessCommunicatorImpl;
|
||||
@ -74,6 +71,12 @@ public class KnxGroupLinkService {
|
||||
knxGroup.getRead().setNextTimestamp(null);
|
||||
log.debug("Successfully sent KnxGroup: {}", knxGroup);
|
||||
return true;
|
||||
} catch (KNXIllegalArgumentException e) {
|
||||
log.error("Failed to read KnxGroup {}", knxGroup);
|
||||
knxGroup.getRead().setErrorCount(knxGroup.getRead().getErrorCount() + 1);
|
||||
knxGroup.getRead().setErrorMessage(e.getMessage());
|
||||
knxGroup.getRead().setNextTimestamp(null);
|
||||
return true;
|
||||
} catch (KNXTimeoutException | KNXFormatException e) {
|
||||
log.error("Failed to read KnxGroup {}", knxGroup);
|
||||
knxGroup.getRead().setErrorCount(knxGroup.getRead().getErrorCount() + 1);
|
||||
|
||||
@ -2,12 +2,10 @@ package de.ph87.homeautomation.web;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||
import org.springframework.web.bind.annotation.CrossOrigin;
|
||||
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
|
||||
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
|
||||
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
|
||||
|
||||
@CrossOrigin
|
||||
@Configuration
|
||||
@EnableWebSocketMessageBroker
|
||||
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user