Skip to content

Commit

Permalink
Revert "fixed wrong state for lock transitioning phase"
Browse files Browse the repository at this point in the history
-> should be fixed on home-assistant side (Nuki returns too early during state change)

This reverts commit 3b60c8d.
  • Loading branch information
hatl committed May 18, 2024
1 parent 3b60c8d commit 6f49297
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
10 changes: 0 additions & 10 deletions widget/source/hass/Entity.mc
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,13 @@ module Hass {
hidden var _mExt; // Is this entity loaded from settings?
hidden var _mSensorValue; // Custom state info text
hidden var _mSensorClass; // Device class for sensor
hidden var _mTransitioning; // For devices which have longer transitioning times from one stat to another (like some smart locks turning the key)

function initialize(entity) {
_mId = entity[:id];
_mName = entity[:name];
_mState = Entity.stringToState(entity[:state]);
_mExt = entity[:ext] == true;
_mSensorClass = entity[:sensorClass];
_mTransitioning = false;

if (_mId.find("scene.") != null) {
_mType = TYPE_SCENE;
Expand Down Expand Up @@ -176,14 +174,6 @@ module Hass {
_mSensorClass = newSensorClass;
}

function getTransitioning() {
return _mTransitioning;
}

function setTransitioning(newState) {
_mTransitioning = newState;
}

function isExternal() {
return _mExt;
}
Expand Down
10 changes: 2 additions & 8 deletions widget/source/hass/Hass.mc
Original file line number Diff line number Diff line change
Expand Up @@ -221,14 +221,9 @@ module Hass {
if (_entitiesToRefresh.size() > 0) {
var entity = _entitiesToRefresh[0];

if(entity.getTransitioning()) {
entity.setTransitioning(false);
}
else {
_entitiesToRefresh.remove(entity);
_entitiesToRefresh.remove(entity);

refreshEntity(entity, Utils.method(Hass, :_refreshPendingEntities));
}
refreshEntity(entity, Utils.method(Hass, :_refreshPendingEntities));
} else {
// We need to finalize with reading the scenes from settings again,
// so that the name config takes precedence
Expand Down Expand Up @@ -353,7 +348,6 @@ module Hass {
action = Client.ENTITY_ACTION_TURN_ON;
loadingText = "Running";
} else if (entity.getType() == Entity.TYPE_LOCK) {
entity.setTransitioning(true);
if (currentState == Entity.STATE_UNLOCKED) {
action = Client.ENTITY_ACTION_LOCK;
loadingText = "Locking";
Expand Down

0 comments on commit 6f49297

Please sign in to comment.