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

tv remote app #3548

Merged
merged 14 commits into from
Sep 12, 2024
Merged

tv remote app #3548

merged 14 commits into from
Sep 12, 2024

Conversation

Guptilious
Copy link
Contributor

App allows the user to send tv remote input commands to their tv. Currently support is only for panasonic tv's as that's what I had to work with.

I have done my best how to use and navigate app pages. The app would require the user to create a webserver to receive requests. I have detailed and link to my version.

I've done what I can to make the install user friendly but appriciate this may go beyond the scope.

@thyttan
Copy link
Collaborator

thyttan commented Aug 28, 2024

The linter complains about:

  • Some variables are never used - either delete them or comment them out.
  • some variables are not defined with var, let, or const. Add that where it complains.

If your on a desktop you can see the warnings in the 'files' tab of the PR now that the linter has run.

@Guptilious
Copy link
Contributor Author

@thyttan this is my first time doing a public repo, so let me know if anything I'm doing is wrong for this.

When making changes do I just amend my code and hit another merge request or do I need to do something else as this one is open?

Based on what's being flagged:

Variables and functions I can comment out:

  • drawTImeout
  • samsungmenu
  • prevNumber

The below variables it says are never used, are used by the app, but they have to be uploaded by the user. After that they will only run when a http request is sent.

  • serverPort
  • tvIp

The rest state aren't always defined and have checks for that and respond on that.

  • checkValue
  • IPASSIGN
  • samsIp

There is also an issue stating I'm using a deprecated part of Node but I'm not sure what action I need to take here.

@thyttan
Copy link
Collaborator

thyttan commented Aug 28, 2024

I'm out moving around - I'll check in again in a bit.

But if you make changes on your master branch they will automatically show up here. 🙂👌

@Guptilious
Copy link
Contributor Author

Awesome.

I've hunted through and think I've manged to resolve the errors that are getting kicked out.

Everything has now been commited back to the master branch, so... 🤞🏼

@thyttan
Copy link
Collaborator

thyttan commented Aug 31, 2024

Great - thanks for fixing those!

Now, If I install the app from your app loader and try to run it without doing the setup steps in the readme I get this:

Uncaught Error: Can't read property 'webServerDns' of undefined
 at line 2 col 616 in tvremote.app.js
...me,true);let serverDns=serverData.webServerDns;let serverPort=serverD...
                                       ^
> 

This then renders the watch mostly unresponsive until I long press the hardware button to reset to the clock face.

I think we should handle this before merging here. So either some error handling or making sure we don't end up with a breaking error in the first place.

I think if the user didn't do the manual part of the setup detailed in the readme then the app should display a hint message to go back and read the readme.

Another way to solve it could be to add a customiser for the app on the app loader entry where the user types in the required data (https://www.espruino.com/Bangle.js+Custom). A little more involved maybe.

added an if statement to display an alert message if the tv config file is not present.
@Guptilious
Copy link
Contributor Author

I've added an 'if' statement to the end of the app, which should provide an Alert to the user if the config file isn't present. Clicking 'ok' should then take you to the main app without an error.

Adding a customiser is definetly a cleaner approach for the user long term but I've never worked with html before, so I'd need a bit more time to figure how to include this. That said, the changes made should solve the problem for now but let me know if something else needs tweaking.

apps/tvremote/app.js Outdated Show resolved Hide resolved
@thyttan
Copy link
Collaborator

thyttan commented Sep 12, 2024

As seen in the image below some of the buttons in the app loader are misaligned - @gfwilliams do you know what to do to fix that?

IMG_20240912_091054

gfwilliams added a commit that referenced this pull request Sep 12, 2024
@gfwilliams
Copy link
Member

Argh, well, what happens I think is the buttons are in a tile-action class which is basically its own column top-bottom. So if the main content is too wide (because of a big URL that's not being split up) it pushes the icons off. I've just added something to main.css to tell it to wrap any text to make it fit so that seems to fix it.

... but I feel like probably it'd be better if the buttons were actually part of the title only, so didn't take up real-estate that could be used for wrapping the description.

@thyttan
Copy link
Collaborator

thyttan commented Sep 12, 2024

Thanks for the app and the tweaks!

@thyttan thyttan merged commit 431100f into espruino:master Sep 12, 2024
1 check passed
@Guptilious
Copy link
Contributor Author

No problem :)

On a side note I realised that I forgot to add my name to the sourcecode.

Is there a preferred way you guys have users add that stuff? And in the metadata etc? I can then submit another 'non-code change' merge request

@thyttan
Copy link
Collaborator

thyttan commented Sep 12, 2024

Ah yes, we usually have an entry at the bottom of the readme stating creator/contrubutors. If you want to you can add a comment at e.g. the top of the app.js file and similar as well - but that's not very prevalent for other apps. :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants