Domi04151309 / HomeApp

HomeApp is a small and easy to use smart home app with a simple framework.
https://f-droid.org/packages/io.github.domi04151309.home/
GNU General Public License v3.0
106 stars 24 forks source link

Refresh question #89

Open clach04 opened 1 year ago

clach04 commented 1 year ago

Either a doc issue or a bug.

From https://github.com/Domi04151309/HomeApp/issues/25 it sounds like refresh is NOT expected unless refresh-True is returned.

With version 1.10.0, I'm seeing /commands issued every 1 second (test case https://github.com/clach04/homeapp_demo_server/commit/ed415df7b6e9126adfbc6135d5f692adb9477edb). This seems excessive as the title/summary strings are not update.

Should the refresh be happening? If so:

Domi04151309 commented 1 year ago

The expected poll rate should be 1 second. This should only happen when there is an entry using the switch action to update the switch state in real-time. Do you have any suggestions how this could be included in the wiki? The title and summaries are not updated because this is specific to the switch action's state and should not trigger other layout updates. See here.

clach04 commented 1 year ago

@Domi04151309 for me the 1 second rate was unexpected. A few ideas:

  1. Doc in the wiki, e.g. https://github.com/Domi04151309/HomeApp/wiki/SimpleHome-API#list-of-commands in the commands section to expect a refresh rate of 1 second (if a switch is present?)
  2. Offer an option in config to control that. Ideas:

    • in the UI on the phone
    • better; commands payload could return a "rate" integer value with units seconds, if omitted defaults to 1 second, That way the server can control this.

      {
        "rate": 1,
        "commands": {
          "example": {
            "title": "Title of the command",
            "summary": "Summary of the command",
            "icon": "display",
            "mode": "action"
          }
        }
      }