Skip to content

Commit

Permalink
add subfolder for the location like in previous version
Browse files Browse the repository at this point in the history
  • Loading branch information
philipparndt committed Jan 5, 2021
1 parent 6e560a6 commit 6efbbbb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import org.grohe.ondus.api.OndusService;
import org.grohe.ondus.api.model.BaseAppliance;
import org.grohe.ondus.api.model.Room;
import org.json.JSONObject;

public class GroheAPI {
Expand All @@ -22,7 +23,8 @@ public GroheAPI(final String username, final String password) throws Exception {
public List<GroheDevice> fetchDevices() throws IOException {
final List<GroheDevice> result = new ArrayList<>();
for (final BaseAppliance appliance : service.appliances()) {
final String topic = String.format("grohe/%s/%s", appliance.getRoom(), appliance.getName());
final Room room = appliance.getRoom();
final String topic = String.format("grohe/%s/%s/%s", room.getLocation().getName(), room.getName(), appliance.getName());
result.add(new GroheDevice(topic, this.converter.convert(appliance)));
}

Expand Down

0 comments on commit 6efbbbb

Please sign in to comment.