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

Merge json #23

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Merge json #23

wants to merge 10 commits into from

Conversation

avidraccoon
Copy link
Contributor

@avidraccoon avidraccoon commented Oct 5, 2024

Modifys controllers to use new JSON system

@avidraccoon avidraccoon requested a review from aidnem October 5, 2024 17:25
Copy link
Contributor

@aidnem aidnem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I'm waiting on your answers about the file path and the possible use of an enum for controller type and then I can approve.


public static class Controller {
public int port = -1;
public String type = null;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use an enum for types instead of strings? I feel like this would be less prone to typos and runtime errors that way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will look into it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will probably be a new pull request because I want to add some features to JSONSync to make this easier first


public String toString() {
StringBuilder stringBuilder = new StringBuilder();
stringBuilder.append("Controler Object {\n");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny nitpick but I think there are 2 L's in controller.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep the toString method, because I made it for testing?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If its needed for unit tests then keep it, otherwise we could probably get rid of it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still need to figure out how to do unit tests again, but I will remove it

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok sounds good

} catch (NumberFormatException e) {
if (!Controllers.synced.getObject().buttonShorthands.containsKey(button))
throw new RuntimeException(
"Button Id not found as interger or in shorthands " + button);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another tiny nitpick but I think you accidentally put an extra 'r' before the 'g' in 'integer'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will fix that, and I also need to capitalize the d in Id

@avidraccoon avidraccoon requested a review from aidnem November 6, 2024 16:12
List<Controllers.Controller> controllers = Controllers.getControllers();
System.out.println(controllers.size());
assertEquals(23124, controllers.size());
assertFalse(true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these tests pass?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Forgot to redo them I will that later today

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to get unit testing to work

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh yeah I remember they weren't running before right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you get unit tests working for the monitors?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I got them to run as far as I remember

@minhnguyenbhs
Copy link
Contributor

oh you might have to merge
send me another review request once you're done merging

@jkleiber
Copy link
Member

@avidraccoon what's the status of this PR? I think we should make a branch on high-key-2024 to test this and then merge to main when we get it to work

@avidraccoon
Copy link
Contributor Author

yes and I am realizing how bad this pull requests name is

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.

4 participants