-
Notifications
You must be signed in to change notification settings - Fork 84
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
Device names with numbers only #176
Labels
Comments
Upadate! Found a second occurrence where numberonly devices cause problems: $.fn.filterDeviceReading = function (key, device, param) {
return this.filter(function () {
var elem = $(this);
var value = elem.data(key);
return (value === param && elem.data('device') === device) ||
(value === device + ':' + param) ||
($.inArray(param, value) > -1 && elem.data('device') === device) ||
($.inArray(device + ':' + param, value) > -1);
});
}; Again - .toString to the rescure! $.fn.filterDeviceReading = function (key, device, param) {
return this.filter(function () {
device = device.toString(); // Maybe not needed
key = key.toString(); // Maybe not needed
param = param.toString(); // Maybe not needed
var elem = $(this);
var value = elem.data(key);
if(value != undefined){ // Maybe not needed
value = value.toString();
}
return (value === param && elem.data('device').toString() === device) || // NEEDED (the .toString())
(value === device + ':' + param) ||
($.inArray(param, value) > -1 && elem.data('device').toString() === device) || // NEEDED (the .toString())
($.inArray(device + ':' + param, value) > -1);
});
}; The setup was basically the same, but this time a dimmer widget: <div data-type="dimmer" data-device="196721"
data-get="state"
data-get-on="on" data-get-off="off"
data-set="state"
data-set-on="on" data-set-off="off"
data-dim="value"></div> Would be nice if you could try that for yourself. Best Regards |
knowthelist
added a commit
that referenced
this issue
Dec 21, 2016
knowthelist
added a commit
that referenced
this issue
Dec 21, 2016
knowthelist
added a commit
that referenced
this issue
Dec 21, 2016
knowthelist
added a commit
that referenced
this issue
Dec 22, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I had the problem that when i wanted to use a switch with a device which name consists of only numbers, the current state of the button was not displayed correctly after reloading the page.
My steps to get this bug.
I pushed the button: button turns orange, fhem set's device reading onoff to on.
The i reload the page and the button was gray again.
The switch widget i used.
And the FHEM device definition:
I found a simple fix:
In
js/fhem-tablet-ui.js
Change the lines1418 and 1819 from
Javascript parses it directly to an integer and to call the length option on that does not work really well :').
So i made this change to it:
I am using the latest tablet-ui. Installed today via the 2 commands on the wiki page.
Hopes this helps.
Best Regards
Marcel
The text was updated successfully, but these errors were encountered: