Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[draytonwiser] Fix typos in log messages and class names #9650

Merged
merged 1 commit into from
Jan 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected void startScan() {

@Override
public void onRefresh(final DraytonWiserDTO domainDTOProxy) {
logger.debug("Received data from Drayton Wise device. Parsing to discover devices.");
logger.debug("Received data from Drayton Wiser device. Parsing to discover devices.");
onControllerAdded(domainDTOProxy);
domainDTOProxy.getRooms().forEach(this::onRoomAdded);
domainDTOProxy.getRoomStats().forEach(r -> onRoomStatAdded(domainDTOProxy, r));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ abstract class DraytonWiserThingHandler<T> extends BaseThingHandler implements D

private @Nullable DraytonWiserApi api;
private @Nullable T data;
private @Nullable DraytonWiserDTO draytonWiseDTO;
private @Nullable DraytonWiserDTO draytonWiserDTO;
private @Nullable ScheduledFuture<?> handleCommandRefreshFuture;

protected DraytonWiserThingHandler(final Thing thing) {
Expand Down Expand Up @@ -120,11 +120,11 @@ public final void dispose() {
protected abstract void handleCommand(String channelId, Command command) throws DraytonWiserApiException;

@Override
public final void onRefresh(final DraytonWiserDTO draytonWiseDTO) {
this.draytonWiseDTO = draytonWiseDTO;
public final void onRefresh(final DraytonWiserDTO draytonWiserDTO) {
this.draytonWiserDTO = draytonWiserDTO;
try {
if (ThingHandlerHelper.isHandlerInitialized(this)) {
data = api == null ? null : collectData(draytonWiseDTO);
data = api == null ? null : collectData(draytonWiserDTO);
refresh();
if (data == null) {
updateStatus(ThingStatus.OFFLINE, ThingStatusDetail.OFFLINE.COMMUNICATION_ERROR,
Expand Down Expand Up @@ -162,11 +162,11 @@ protected void updateState(final String channelId, final Supplier<State> stateFu
* Returns the handler specific data object only if all data is available.
* If not all data is available it should return null.
*
* @param draytonWiseDTO data object with domain data as received from the hub
* @param draytonWiserDTO data object with domain data as received from the hub
* @return handler data object if available else null
* @throws DraytonWiserApiException
*/
protected abstract @Nullable T collectData(DraytonWiserDTO draytonWiseDTO) throws DraytonWiserApiException;
protected abstract @Nullable T collectData(DraytonWiserDTO draytonWiserDTO) throws DraytonWiserApiException;

protected DraytonWiserApi getApi() {
final DraytonWiserApi api = this.api;
Expand All @@ -186,13 +186,13 @@ protected T getData() {
return data;
}

protected DraytonWiserDTO getDraytonWiseDTO() {
final DraytonWiserDTO draytonWiseDTO = this.draytonWiseDTO;
protected DraytonWiserDTO getDraytonWiserDTO() {
final DraytonWiserDTO draytonWiserDTO = this.draytonWiserDTO;

if (draytonWiseDTO == null) {
throw new IllegalStateException("DraytonWiseDTO not set");
if (draytonWiserDTO == null) {
throw new IllegalStateException("DraytonWiserDTO not set");
}
return draytonWiseDTO;
return draytonWiserDTO;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ public void refresh() {
if (getThing().getStatus() != ThingStatus.ONLINE) {
updateStatus(ThingStatus.ONLINE);
}
final DraytonWiserDTO draytonWiseDTO = new DraytonWiserDTO(domain);
final DraytonWiserDTO draytonWiserDTO = new DraytonWiserDTO(domain);

updateProperties(draytonWiseDTO);
notifyListeners(draytonWiseDTO);
updateProperties(draytonWiserDTO);
notifyListeners(draytonWiserDTO);
}
logger.debug("Finished refreshing devices");
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private void setSetPoint(final QuantityType<?> command) throws DraytonWiserApiEx

private State getHumidity() {
if (getData().getId() != null && getData().getRoomStatId() != null) {
final RoomStatDTO roomStat = getDraytonWiseDTO().getRoomStat(getData().getRoomStatId());
final RoomStatDTO roomStat = getDraytonWiserDTO().getRoomStat(getData().getRoomStatId());

if (roomStat != null) {
final Integer humidity = roomStat.getMeasuredHumidity();
Expand Down