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

Fix issue #212 - Web can not dim/brighten Insteon lights #231

Merged
merged 8 commits into from
Jul 14, 2013
Merged

Fix issue #212 - Web can not dim/brighten Insteon lights #231

merged 8 commits into from
Jul 14, 2013

Conversation

mstovenour
Copy link
Collaborator

Corrections to the Insteon and web interface code which clean up dim/brighten operations and enable the existing insteon_menu_states parameter in mh.ini. This parameter can now be overridden in mh.private.ini for custom dim states.

Eloy Paris and others added 8 commits June 3, 2013 12:26
INSTEON lights are treated differently in the web interface versus X10
lights, for example: they get different icons, and cannot be dimmed or
brightened. This patch does the following:

- Use the same light icons for INSTEON lights that are used for X10
lights.

- Allow dimming/brightening of INSTEON lights by clicking on the left
or right side of the icon in the web interface (only dimmable light, of
course).

- Fix a logic error that prevents disabling the button image cache. Ran
into this while creating new icons for my web interface.

- As an experimental "feature", and a small delay to try to give MH a
chance to receive the new state of an INSTEON device changed through the
web interface. This will allow the correct state to be displayed when
the web page renders again. Disabled by default since it's just a hack
(though it works good enough for me).

Comments welcome.
Moved responsibility for Insteon states out of http_server.pl and
into the Insteon objects themselves. (i.e. Insteon::DimmableLight)
The existing code was not working with the new object model.  This
is an additional fix for Issue #212.

Open Issue:  http_server.pl->button_action() probably needs to
be modified so Insteon lights dim/brighten correctly.  It
doesn't look like is_dimable() was ever implemented for any MH
object.
Flip order of on/off states to match new web object model
Used the set_states() function rather than directly
modifying data from the Generic_Item class.
Eliminated the save/restore of the "states" array.  I'm
not sure what the original pupose was but saving/restoring
prevents users from defining additional states in their ini
file.  Note that the current device "state" is still stored.
Changed each instance of this calcualtion to use 5/4 rounding prior
to calling sprintf().  There is some issue between perl data types
and the C sprintf() implementation.  In this case perl will print
255 but sprintf will return fe.  Some instances of this were
previously fixed by adding check logic to force fe or 254 to 100%.
I modified all the instances to be consistent.
mstovenour added a commit that referenced this pull request Jul 14, 2013
Fix issue #212 - Web can not dim/brighten Insteon lights
@mstovenour mstovenour merged commit 507561a into hollie:master Jul 14, 2013
@mstovenour mstovenour deleted the fix_issue_212 branch July 14, 2013 04:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant