Giter Site home page Giter Site logo

remote-ui's Introduction

Remote-UI

Frontend application for Remote Two written in Qt 5 and QML.

This application is part of the official Remote Two firmware. Custom versions can be built and installed on the device.

It also runs on desktops for local development and testing. When run on a desktop, the app becomes a device simulator: the input buttons of the Remote Two are shown in a separate window to control the app as on a real device.

Remote Two Simulator

Requirements

  • Mac or Linux computer / virtual machine.
  • Qt 5.15.2 (or a newer patch release) and Qt Creator.
  • Remote Two Core Simulator for local development.
  • Docker for Remote Two Core Simulator and cross-compilation.

Build

Use the Qt Creator IDE and open the remote-ui.pro project file.

A properly configured build kit for Qt 5.15.x is required. Please see our following setup guides and the official Qt documentation for more information:

The GitHub build action is also reference on how our automatic build works.

Run

For local development, start the Remote Two Core Simulator and run the remote-ui app from Qt Creator.

  1. Start Core Simulator docker-compose runtime
  2. The application requires environment variables to pass configuration parameters:
  • UC_TOKEN_PATH: path to the token file containing the WebSocket Core-API access token for the Core / Simulator.
  • Add UC_TOKEN_PATH=$CORE_SIMULATOR_PATH/docker/ui-env/ws-token in the run environment settings.

Environment Variables

Variable Description Default
UC_MODEL The model of the hardware DEV
UC_DISPLAY_WIDTH Width of the display 480
UC_DISPLAY_HEIGHT Height of the display 850
UC_DISPLAY_SCALE Scale factor for the display 0.5
UC_SOCKET_URL Websocket url of the core ws://127.0.0.1:8080/ws
UC_TOKEN_PATH Location of the token file from the core None
UC_RESOURCE_PATH Location of the resources directory None
UC_SOUND_EFFECTS_PATH Location of the sound effects directory None

Remote Two Cross-Compilation and Custom Installation

A custom version of the remote-ui app can be installed on the Remote-Two device.

This requires a static Qt build, since the device doesn't contain any Qt libraries. See Cross-Compile & Installation documentation.

Please be aware, that installing a custom remote-ui version on the Remote Two device will void your warranty!

Contributing

Please read CONTRIBUTING.md for details on how to contribute and submit pull requests to us.

License

The Remote-UI is published under the GPL v3 open source license.

Copyright and trademarks

The Unfolded Circle logo is a registered trademark of Unfolded Circle ApS.

Graphics, icons and design elements are protected by copyright law and are the intellectual property of Unfolded Circle ApS. These elements may not be used, reproduced, distributed, or modified in any form without the prior written consent of Unfolded Circle ApS.

Thank you for respecting our intellectual property rights.

remote-ui's People

Contributors

martonborzak avatar zehnm avatar

Stargazers

 avatar  avatar Taiyou Kuo avatar  avatar

Watchers

 avatar  avatar

Forkers

dwffls

remote-ui's Issues

Entity states are not in the translation resources

Is there an existing issue for this?

  • I have searched the existing issues

Description

As reported in:

How to Reproduce

See linked issue

Expected behavior

All entity states must be translation texts so they can be translated on crowdin.

UI version

0.37.2

Additional context

The technical entity state enum may not be used for displaying it in the UI. The enum must be mapped to resource strings. Only if an enum value is not found in the resources, it may be used as a fallback.

[Bug] Deactivating an activity disables physical button navigation

Is there an existing issue for this?

  • I have searched the existing issues

Description

After turning off an activity using the power button, the user interface can't be navigated using physical button controls.

How to Reproduce

  1. Activate an activity from the home screen using the physical buttons.
  2. Deactivate the activity using the power button.
  3. Attempt to navigate the user interface using the Up/Down/Left/Right and select buttons.

Expected behavior

The active entity should be able to be highlighted and selected without touching the screen.

UI version

0.36.1

Additional context

I can temporarily fix this issue by tapping on the current profile, then closing it using the "X" button in the top-left.

Profile page looses macro icons

Is there an existing issue for this?

  • I have searched the existing issues

Description

As reported in:

How to Reproduce

  1. Create 6 dummy Macros in the web-configurator, no included entities required. E.g. macro 1, ..., macro 6
  2. Create a new profile page
  3. Add all dummy macros to profile page
  4. Change all macro icons to something else than the default, e.g. light icons
  5. All shows up correctly on the remote-ui
  6. Wait (minutes / hours) and the custom icons are replaced with the default macro icon

Expected behavior

Custom icons don't revert to default icons

UI version

0.36.0

Additional context

I could also observe it after a reboot. I didn't check immediately, but after 45min the icons were gone.

  • Remote was in charger the whole time
  • No standby
  • Checking the macros with the Core-API: everything ok, still with custom icons
  • Same with web-configurator: all ok

[Bug] Rename of entities not correctly taken into account

Is there an existing issue for this?

  • I have searched the existing issues

Description

When I rename an entity from the ui pages or from activity screen, it is not always correctly applied.
I found the culprit after making a backup and open it : when I open the activities/uc.main.XXX.json file, there are 2 names, one for english and one for my language (french here) and both are not the same. It is unclear which one is displayed but it is also unclear why one can define a different name per language whereas it is not possible to set up from the UI
{"entity_id":"uc.main.1267279d-3195-4b50-a719-a087dbeae315","entity_type":"activity","integration_id":"uc.main","name":{"en":"Regarder TV Orange","fr":"Regarder TV Orange IP"}...

How to Reproduce

Not systematic : rename an activity then go to a page where is it is displayed.
The old name is still displayed

Expected behavior

The new name should be displayed every pages where the entity is added.

UI version

1.6.1

Additional context

No response

[Bug] Project ERROR while compiling static qt framework

Is there an existing issue for this?

  • I have searched the existing issues

Description

When trying to compile a static qt framework on macOS 14.1 I get stuck at step 4:

~/Qt/5.15.2/Src/configure --prefix=~/Qt/5.15.2/clang_64-static -static -debug-and-release \                          projects/qt-static-5.15.2 18:13:00
    -nomake examples -nomake tests \
    -qt-libpng -qt-zlib -qt-libjpeg \
    -opensource -confirm-license \
    -opengl -qt-freetype -qt-pcre -qt-harfbuzz -platform macx-clang
+ cd qtbase
+ /Users/kenny/Qt/5.15.2/Src/qtbase/configure -top-level --prefix=~/Qt/5.15.2/clang_64-static -static -debug-and-release -nomake examples -nomake tests -qt-libpng -qt-zlib -qt-libjpeg -opensource -confirm-license -opengl -qt-freetype -qt-pcre -qt-harfbuzz -platform macx-clang
Preparing build tree...
Creating qmake...
...................................................................................................Done.
Info: creating super cache file /Users/kenny/projects/qt-static-5.15.2/.qmake.super
Info: creating cache file /Users/kenny/projects/qt-static-5.15.2/.qmake.cache
Info: creating stash file /Users/kenny/projects/qt-static-5.15.2/.qmake.stash
Project ERROR: failed to parse default search paths from compiler output

Output with -v:
verbose.txt

How to Reproduce

  1. Follow the instructions mentioned here https://github.com/unfoldedcircle/remote-ui/blob/main/docs/static-compile.md

Expected behavior

There should be no error at the end

UI version

No response

Additional context

No response

Invalid switch-entity command logic if switch only supports ON_OFF

Is there an existing issue for this?

  • I have searched the existing issues

Description

Refers to:

While testing the referred issue, I noticed that the UI sends invalid switch commands.

How to Reproduce

  1. Create a demo integration with a switch having only the on_off feature
{"kind": "resp", "req_id": 5, "code": 200, "msg": "available_entities", "msg_data": {"available_entities": [{"entity_id": "switch1", "entity_type": "switch", "device_id": null, "features": ["on_off"], "name": {"en": "Demo switch"}, "area": null, "device_class": null}]}}
  1. Add entity to UI
  2. Press the switch. Expected: on or off command, but toggle is sent:
{"kind":"req","id":7,"msg":"entity_command","msg_data":{"cmd_id":"toggle","entity_id":"switch1","entity_type":"switch"}}

Expected behavior

If switch doesn't support the toggle feature and only on_off, the UI may not send a toggle command.

UI version

0.36.0

Additional context

Python demo integration:

#!/usr/bin/env python3
"""Switch entity integration example. Bare minimum of an integration driver."""
import asyncio
import logging
from typing import Any

import ucapi
from ucapi import switch

loop = asyncio.get_event_loop()
api = ucapi.IntegrationAPI(loop)


async def cmd_handler(
    entity: ucapi.Switch, cmd_id: str, _params: dict[str, Any] | None
) -> ucapi.StatusCodes:
    """
    Switch command handler.

    Called by the integration-API if a command is sent to a configured switch-entity.

    :param entity: switch entity
    :param cmd_id: command
    :param _params: optional command parameters
    :return: status of the command
    """
    print(f"Got {entity.id} command request: {cmd_id}")

    state = None
    if cmd_id == switch.Commands.ON:
        state = switch.States.ON
    elif cmd_id == switch.Commands.OFF:
        state = switch.States.OFF
    elif cmd_id == switch.Commands.TOGGLE:
        print("Toggle command should not be sent, entity only has on_off feature!")
        if entity.attributes[switch.Attributes.STATE] == switch.States.OFF:
            state = switch.States.ON
        else:
            state = switch.States.OFF

    if state:
        api.configured_entities.update_attributes(
            entity.id, {switch.Attributes.STATE: state}
        )

    return ucapi.StatusCodes.OK


@api.listens_to(ucapi.Events.CONNECT)
async def on_connect() -> None:
    # When the remote connects, we just set the device state. We are ready all the time!
    await api.set_device_state(ucapi.DeviceStates.CONNECTED)


if __name__ == "__main__":
    logging.basicConfig()

    entity = ucapi.Switch(
        "switch1",
        "Demo switch",
        [switch.Features.ON_OFF],
        {switch.Attributes.STATE: switch.States.OFF},
        cmd_handler=cmd_handler,
    )
    api.available_entities.add(entity)

    loop.run_until_complete(api.init("switch.json"))
    loop.run_forever()

Wrong language shown for entity names

Is there an existing issue for this?

  • I have searched the existing issues

Description

As reported in:

This occurs for non-english language settings. The remote UI still shows the original English name, whereas the web-configurator shows the language specific text.

Issues:

  • remote UI doesn't properly check language specific strings: no fallback to main language without a country variant. For example, it only checks de_CH instead of also de if not found.
  • web-configurator only stores language specific texts with language code without country variant. For example de instead of de_CH.

How to Reproduce

  1. Set language to another language than English, for example German
  2. Create a remote-entity with the default name of a selected manufacturer IR dataset, e.g. Generic TV 2 Smart Home
  3. Rename remote-entity, e.g. to LG TV
  4. --> web-configurator shows correct name
  5. --> remote-ui still shows original (English) name
  6. Access the remote-entity with the REST-API to show all language strings.
    Simplified data structure:
    {
        "entity_id": "uc.main.d899d6e4-ba7f-42dd-a586-1ea77b5bd8e3",
        "entity_type": "remote",
        "integration_id": "uc.main",
        "name": {
            "de": "LG TV",
            "en": "Generic TV 2 Smart Home"
        },
        "icon": "uc:remote"
    }

Expected behavior

Correct language is shown with fallback to non-country specific language if the language text doesn't contain a country variant.

UI version

0.36.0

Additional context

No response

Integration cannot be deleted

Is there an existing issue for this?

  • I have searched the existing issues

Description

For testing the Android TV integration I wanted to remove it in the UI.

Clicking Delete does nothing, the remote-ui log only shows:

qrc:/components/integrations/Info.qml:461: TypeError: Cannot read property 'external' of null

This message is logged every time "Delete" is pressed. There was no other log from the core.

After rebooting the remote, the integration could be deleted.

How to Reproduce

not reproducable after reboot

Expected behavior

Delete works the first time

UI version

0.36.0

Additional context

This issue might be triggered by deleting an external integration first:
Before trying to delete the Android TV integration, I could successfully delete an external test integration.

[Feature request] Page groups

Is there an existing issue for this?

  • I have searched the existing issues

Description

I would like to start with my first contribution but since it falls in the "substantial" category I would like to discuss the feature before implementing anything.

My plan is to add page groups to the interface editor:
Bildschirmfoto 2023-12-12 um 20 57 19

Users can add multiple groups which all can have their own pages. When adding a new group the user can give a name and set a checkbox whether it should be possible to scroll though the pages (with the scroll indicator dots on the bottom) or if a page when opened can't be switched.

Also I would like to add a new section in commands: "Go to page":
Bildschirmfoto 2023-12-12 um 19 01 25 Kopie

The user can either select a specific page to open or choose "Go to previous page".
The Previous page option will go to the last visited page. When pressed on the first page nothing happens but when pressed on a page that was opened through the "Show page" command the parent page is added to a stack.

The go to page option can be combined with a regular "command" and thus allows for switching pages and issuing a command at the same time.

Expected behavior

This change will help with multiple use cases:

Modal with a confirm question:
Bildschirmfoto 2023-12-12 um 19 04 26
The X button will use the "Previous page" command. And the checkbox will issue a command to turn off the TV and in parallel it should open the previous page. If the dialog is a multi step dialog (eg. Are you really really sure) you could also add a second page to the group with the same design, slightly different text but on the first page the checkbox would simply switch to page 2. In this scenario the option to allow manual page changes in this group could be disabled.

Another option would be a completely separate section with eg. light options or smart home actions. You can add a button to your start page for opening the smart home section which then could have several sub pages or even sub groups.

Additional context

No response

Invalid Dock brightness value shown

Is there an existing issue for this?

  • I have searched the existing issues

Description

The dock brightness doesn't show the correct value. Most likely it's still the default value and not using the returned value from the Core-API.

As reported in:

How to Reproduce

  1. Change dock brightness in web-configurator
  2. Open dock settings in remote-ui
  3. Setting remains at 60%

Expected behavior

Current value taken from Core-API

UI version

0.37.2

Additional context

No response

Last entity in group cannot be removed

Is there an existing issue for this?

  • I have searched the existing issues

Description

Tracking issue for:

I could reproduce it, reboot is not even required: after removing the last entity in the group and closing the edit group dialog, the entity is still shown on the main page.

If the entity is removed with the web-configurator, it is no longer in the group.

How to Reproduce

See referenced issue

Expected behavior

Entity is removed from group

UI version

0.36.0

Additional context

No response

Media-player keeps trying to load an unsupported image format

Is there an existing issue for this?

  • I have searched the existing issues

Description

Reported in:

How to Reproduce

Probably the easiest way is to manually prepare a test integration with a fixed image URL that points to an invalid / unsupported image.

Expected behavior

If an image format is not supported, abort loading and start loading again after the image url changed.

UI version

No response

Additional context

No response

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.