Skip to content

Commit

Permalink
Extract some constants
Browse files Browse the repository at this point in the history
  • Loading branch information
grafnu committed Oct 4, 2024
1 parent 875a660 commit 306a3ad
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
*/
public class PubSubIotAccessProvider extends IotAccessBase {

private static final String COMMAND_SUBTYPE = SubType.COMMANDS.value();
private static final String CONFIG_SUBTYPE = SubType.CONFIG.value();
private final String projectId;
private final String topic;
private final Publisher publisher;
Expand Down Expand Up @@ -75,12 +77,12 @@ public boolean isEnabled() {

@Override
public void sendCommandBase(Envelope envelope, SubFolder folder, String message) {
publish(envelope, SubType.COMMANDS.value(), folder, message);
publish(envelope, COMMAND_SUBTYPE, folder, message);
}

@Override
public String updateConfig(Envelope envelope, String config, Long version) {
publish(envelope, SubType.CONFIG.value(), null, config);
publish(envelope, CONFIG_SUBTYPE, null, config);
return config;
}

Expand Down

0 comments on commit 306a3ad

Please sign in to comment.