Giter Club home page Giter Club logo

Comments (10)

sde1000 avatar sde1000 commented on August 17, 2024

In what way is it broken?

from python-dali.

caiwan avatar caiwan commented on August 17, 2024

The _commands property doesn't seem to exist, unless you intantitate these classes. I didn't found any solution, rather than registering these command types by hand.

Was from_bytes were broken before?

from python-dali.

sde1000 avatar sde1000 commented on August 17, 2024

Are you using python 3? The way metaclasses are declared has changed between python 2 and python 3:

Python 2:

class foo(object):
    __metaclass__ = bar
    pass

Python 3:

class foo(metaclass=bar):
    pass

from python-dali.

caiwan avatar caiwan commented on August 17, 2024

Is there any chance to make it work with version (at the same time)?

from python-dali.

sde1000 avatar sde1000 commented on August 17, 2024

It's a bit of a pain; you either write it in quite a convoluted way, or make use of a compatibility library like six.

How important is python 3 compatibility to you at the moment? I think I mentioned before that I do intend to port this to python 3 at some point, but keeping python 2 compatibility is important to me for now; I make use of this library in some pubs that use quicktill which is python 2 for now. (Although, having said that, it might be time for me to look at converting quicktill to python 3 now most of its library dependencies have been ported.)

from python-dali.

caiwan avatar caiwan commented on August 17, 2024

I'll rollback my changes to see if it's broken under py 2.7 or not. I'll also get know that if py3 is really nesesarry, or not. (I'm fine w/ py2, but the environment, where it will be used... )

from python-dali.

caiwan avatar caiwan commented on August 17, 2024

What exactly does the _devicetype parameter in the commands, and how it sohuld really work?
Now, from_byte lead me to (call) stack overflow.

from python-dali.

sde1000 avatar sde1000 commented on August 17, 2024

IEC 62386 defines many different types of control gear. Some commands are common between all of them; these are defined in IEC 62386-102. Other commands are specific to particular types of control gear, for example fluorescent ballasts, emergency lighting controllers, LED lighting controllers, and so on and these commands are defined in IEC 62386-201, 202, 203, ... Part 201 defines commands for device type 0, part 202 defines commands for device type 1, and so on.

These device-specific commands (referred to in the standard as "application extended commands") all occupy the same "space" - they are encoded in ways that conflict with each other. To issue one of these commands, you first send the EnableDeviceType(n) command with the appropriate value of n, so only devices of that type will respond to the command.

When you are decoding commands from their packed representation back to Command object instances, you need to specify the type of device the command is for so you get the right one. If the previous command was EnableDeviceType(n) then the device type is n; if the previous command was anything else then the device type is 0.

from python-dali.

rnixx avatar rnixx commented on August 17, 2024

if you want py2/3 compatibility (which actually is a good idea) with metaclasses, take a look at http://stackoverflow.com/questions/18513821/python-metaclass-understanding-the-with-metaclass

from python-dali.

caiwan avatar caiwan commented on August 17, 2024

It seems ifex by now, I'll stay with using py 2.7

from python-dali.

Related Issues (20)

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.