mirror of
https://github.com/bwssytems/ha-bridge.git
synced 2025-12-19 08:28:46 +00:00
add support for timestamp http URL variable
- certain devices require a current date/time in their HTTP request (Warema shades)
This commit is contained in:
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
|
||||
public class TimeDecode {
|
||||
private static final Logger log = LoggerFactory.getLogger(TimeDecode.class);
|
||||
private static final String TIME_FORMAT = "${time.format(";
|
||||
private static final String TIMESTAMP = "${timestamp}";
|
||||
private static final String TIME_FORMAT_CLOSE = ")}";
|
||||
|
||||
/*
|
||||
@@ -38,6 +39,10 @@ public class TimeDecode {
|
||||
log.warn("Could not format current time: " + timeFormatDescriptor, e);
|
||||
}
|
||||
}
|
||||
if (request.contains(TIMESTAMP)) {
|
||||
request = request.replace(TIMESTAMP, String.valueOf(System.currentTimeMillis()));
|
||||
notDone = true;
|
||||
}
|
||||
}
|
||||
return request;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user