Branch cleaning

This commit is contained in:
Claudio Maggioni 2020-03-14 20:07:58 +01:00
parent 749d79d51e
commit 73e1328d70
4 changed files with 2 additions and 57 deletions

View file

@ -15,7 +15,6 @@ repositories {
dependencies {
compile 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final'
compile "org.springframework.boot:spring-boot-starter-websocket"
implementation 'org.springframework.boot:spring-boot-starter'
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-security'

View file

@ -33,11 +33,7 @@ public class KnobDimmer extends Dimmer {
dl.setIntensity((dl.getIntensity() + 5) % 105);
} else {
dl.setIntensity(dl.getIntensity() + (5 - remainder));
if (dl.getIntensity() == 0) {
dl.setIntensity(100);
} else {
dl.setIntensity(dl.getIntensity() - 5);
}
dl.setIntensity((dl.getIntensity() - 5) % 105);
}
}
}

View file

@ -1,24 +0,0 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut.websocket;
import java.io.IOException;
import javax.websocket.*;
import javax.websocket.server.ServerEndpoint;
@ServerEndpoint(
value =
"theEndpointMustHaveAShotNameBecauseAndreaBritesMartesMaronesIsAVeryNiceProgrammerThatMustTypeThisByHand.exe") // DONE: choose path
public class HouseEndpoint {
private Session session;
@OnOpen
public void onOpen(Session session) throws IOException {}
@OnMessage
public void onMessage() throws IOException {}
@OnClose
public void onClose() {}
@OnError
public void onError() {}
}

View file

@ -1,26 +0,0 @@
package ch.usi.inf.sa4.sanmarinoes.smarthut.websocket;
import org.springframework.context.annotation.Configuration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.web.socket.config.annotation.EnableWebSocketMessageBroker;
import org.springframework.web.socket.config.annotation.StompEndpointRegistry;
import org.springframework.web.socket.config.annotation.WebSocketMessageBrokerConfigurer;
@Configuration
@EnableWebSocketMessageBroker
public class WebSocketConfig implements WebSocketMessageBrokerConfigurer {
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/house")
.setAllowedOrigins("domainURL")
.withSockJS(); // TODO: set domain URL
}
/** Creates message brokers in-memory to send and receive messages for topic and queue route */
@Override
public void configureMessageBroker(MessageBrokerRegistry config) {
config.enableSimpleBroker("/topic/", "/queue/");
config.setApplicationDestinationPrefixes("/app");
}
}