Premise How do I create a custom home object or modify inheritance?

Motorola Premise

etc6849

Senior Member
Please help. I am trying to create my own home object that will hopefully be a multizoneswitcher with menu and radio tuner controls.

However, I can't figure out how to permanently modify this: sys://Schema/Device/AudioVideo/Home/MatrixSwitcherZone

I want to forever inherit the following classes: menu and radiotuner to Schema/Device/AudioVideo/Home/MatrixSwitcherZone. I know I can do this using ctrl + shift + a and navigating to it. However, premise undoes my change everytime the server's service restarts!

Any ideas? Is there a way to add inheritance through scripting? I didn't see a method to do this ;) Having the tuner bound is crucial or I suspect that msense will not work properly?
 
Why not just create your own class that inherits from MatrixSwitcherZone?
Another alternative might be to create an extension class of MatrixSwitcherZone.
 
Yes, you are right ;)

I couldn't do that before when I tried creating my own class was I was trying to do it under sys://Schema/Device/AudioVideo/Home/.

Apparently, we're blocked from creating new classes under the home container and when I modified things under that directory, they disappeared upon reboot.

However, if I create a new class that is a copy of sys://Schema/Device/AudioVideo/Home/MatrixSwitcherZone under a new module instead it works!

Thanks

quote name='JimSpr' date='Jul 1 2009, 11:09 PM' post='118067']
Why not just create your own class that inherits from MatrixSwitcherZone?
Another alternative might be to create an extension class of MatrixSwitcherZone.
[/quote]
 
for my own benefit though, how would I add/remove/modify inherited classes in premise vba scripting? i looked through the help files and couldn't find anything...
 
yes. So far, I've been able to do everything that I could with a mouse in premise through code. But for some reason adding or creating inherited relationships with vba in premise is not discussed in the help files? This may be because it's common knowledge and I'm just a novice ;)

...how would I add/remove/modify inherited classes in premise vba scripting? ...
You want to programmatically define a new class, its inheritance relationships and methods?
 
... adding or creating inherited relationships with vba in premise is not discussed in the help files? This may be because it's common knowledge ...

Programmatically defining new classes, or changing inheritance relationships, is not a common requirement.

I think the most complex discussion, on the old Premise Support Forum, was about the development of an Observer pattern. The thread contains a few examples where Inheritance and Extension are programmatically defined using the CreateObject method. The CreateObject's first argument is the Path and is the schema definition.

Path
  • Inheritance "sys://Schema/System/SuperClass"
  • Extension "sys://Schema/System/SubClass"
  • Method "sys://Schema/Scripting/ClassProperty"

A script that programmatically defines a new class and/or relationships and methods is an advanced beast. You'd be hard-pressed to find a Home Automation program that even offers this ability!

No offense but you're either writing a script to solve a very complex problem with an equally complex solution or you've overlooked a simpler technique. Are you 100% certain you need to modify a class's inheritance relationships 'on the fly'?
 
Thanks for the info ;) This is very good stuff 123!

... adding or creating inherited relationships with vba in premise is not discussed in the help files? This may be because it's common knowledge ...

Programmatically defining new classes, or changing inheritance relationships, is not a common requirement.

I think the most complex discussion, on the old Premise Support Forum, was about the development of an Observer pattern. The thread contains a few examples where Inheritance and Extension are programmatically defined using the CreateObject method. The CreateObject's first argument is the Path and is the schema definition.

Path
  • Inheritance "sys://Schema/System/SuperClass"
  • Extension "sys://Schema/System/SubClass"
  • Method "sys://Schema/Scripting/ClassProperty"

A script that programmatically defines a new class and/or relationships and methods is an advanced beast. You'd be hard-pressed to find a Home Automation program that even offers this ability!

No offense but you're either writing a script to solve a very complex problem with an equally complex solution or you've overlooked a simpler technique. Are you 100% certain you need to modify a class's inheritance relationships 'on the fly'?
 
Back
Top