bitfocus / companion-module-panasonic-ptz

MIT License
8 stars 15 forks source link

Module Version 3.0 Rewrite #81

Closed premultiply closed 2 weeks ago

premultiply commented 3 months ago

sdplus

...and many more things that I stumbled upon but can't remember in detail ;)

Attention: Since this is more or less a complete rewrite of this module with clean-ups, refactoring and is also an attempt to achieve simplification of names, variables, actions, feedback, etc., there is unfortunately no upgrade script (yet?) for automatically updating or migrating existing companion configurations. In most cases, you will therefore have to start from scratch with your companion configuration for functions of this module. I'm very sorry, but the changes (and improvements) are too large to be migrated automatically with reasonable effort. But I also have to admit that I still don't understand enough how upgrade scripts work. Maybe someone can support me?

Testing by myself on HR140, UE50, UE150, UE100, HE40, CX350

Open things that still need to be done and others that are being worked on:

Replaces #80 #79 #76 Fixes #77 #67 #61 #56 #50 #36 #31 Should fix #54 #64 #14 May fix #57 #53 #43 #41 Requires https://github.com/bitfocus/companion/issues/2837

josephdadams commented 3 months ago

@premultiply as this module is used quite extensively by many, make sure you write an upgrade script that converts any renamed actions, feedbacks, variables, etc. to fit your new format. We will not be able to incorporate your work until then. Thanks!

premultiply commented 3 months ago

Since this is more or less a complete rewrite of this module with clean-ups, refactoring and is also an attempt to achieve simplification of names, variables, actions, feedback, etc., there is unfortunately no upgrade script for automatically updating or migrating existing companion configurations. Many things have changed (and fixed) how they work internally so I do not see a good way to migrate them yet. In most cases, you will therefore have to start from scratch with your configuration regarding this module. I'm very sorry, but the changes (and improvements) are too large to be migrated automatically with reasonable effort. But I also have to admit that I still don't understand enough how upgrade scripts work. Maybe someone can support me?

Maybe it would be even better to add it as new module and keep the current version for legacy reasons?

Julusian commented 3 months ago

If you want to look at some upgrade scripts, the atem module has a bunch at varying complexity https://github.com/bitfocus/companion-module-bmd-atem/blob/main/src/upgrades.ts I'm not aware of anywhere that has had to handle a breaking refactor of this scale though. There isn't currently a way to do anything for usages of variables either.

Tbh, unless there are upgrade scripts that handle a majority of things, then I would prefer to add this as a new module. There are 700-1000 users of the module each day, working out to about 2000 unique users within a period of a month. That is something like 3-5% of the users of Companion, and last I checked this was in the top 20 most used modules.

So that is a lot of users who will not enjoy the upgrade to the version which includes this, if it isn't done as a new module or with sufficient upgrade scripts. Maybe we can do something in the ui connections list to nudge users to switch to the new module. And there is other future work being thought about which could help mitigate this without needing to create a new module, but that won't be ready for 3.3

premultiply commented 2 months ago

@Julusian What do you think about creating this upgrade as new module companion-module-panasonic-camera (fits better to the supported models including non-PTZ cameras) and depreciating this companion-module-panasonic-ptz module.

Julusian commented 2 months ago

@premultiply yes, I think that is the best way forward. I've created a new repository and sent you an invite to it https://github.com/bitfocus/companion-module-panasonic-cameras Push your code there, then once it is included in the betas we can look at how best to label this repository/module as deprecated and what we can do to gently encourage users to migrate across. I don't want to keep this repository around for now, so that bugfixes can still be made for the old module.

premultiply commented 2 months ago

Thx @Julusian

Will be left here for reference. Further work will be continued at https://github.com/bitfocus/companion-module-panasonic-cameras/

cyprient commented 2 months ago

@Julusian I will continue to maintain this module as it is used a lot on Companion, and big Companion configurations may be hard and time consuming to move to a new module.

premultiply commented 2 weeks ago

Replaced by https://github.com/bitfocus/companion-module-panasonic-cameras/releases/tag/v1.0.0