Giter VIP home page Giter VIP logo

Comments (5)

kctrey avatar kctrey commented on September 25, 2024 1

This is fixed in 4.2.6

from wxcadm.

kctrey avatar kctrey commented on September 25, 2024

@MikeRalston98 The Person.add_device() method can't be used to add a Person to an existing Device, so what you might be looking for is the Device.members.add() method, which does have those fields available. I do have an enhancement planned for the next release that allows you to modify existing DeviceMember entries to change those values, so, if you are creating a new device with Person.add_device(), you would be able to use the returned Device instance to modify the members.

What I will probably do is add a method in the DeviceMemberList to allow you to find the member by the Person, making that easier. What I envision is something like the following:

new_device = person.add_device(model=model, mac=mac)
member = new_device.members.get(person=person)
member.set_line_label('New Line Label')
member.set_allow_call_decline_enabled=False

or maybe a shorter method that allows both in one call. Does that make sense and would it fit your needs? That method aligns better to the Webex logic where the Person/Workspace is a "member" of the device rather than being an "owner" of the Device.

from wxcadm.

kctrey avatar kctrey commented on September 25, 2024

I realized that your first paragraph already mentioned what I pointed out. Regardless, I think the way I'll have to do it is to just allow you to set it at the DeviceMember level. Plus that will give more flexibility for any future changes.

from wxcadm.

MikeRalston98 avatar MikeRalston98 commented on September 25, 2024

@kctrey Yes, that would be exactly what I'm looking for. Building out a script for migrations from Call Manager and after I assign the user licenses, I add the device with person.add_device. Often during the migrations, they'll want the line label set to what they had before and also want the ability to have calls decline only on that device since they'll have shared lines and whatnot.

The methods you posted in your reply would be perfect. I personally don't see a need for an all-in-one type call for those types of settings. Appreciate the quick response.

from wxcadm.

kctrey avatar kctrey commented on September 25, 2024

@MikeRalston98 I had to change direction a little, because I forgot what I return from the Person.add_device(). Because I return a dict, you'll have to do the following (or similar):

device_details = person.add_device(model=model, mac=macaddress)
device = device_details['device_object']
member = device.members.get(person=person)
member.set_line_label('New Label')
member.set_call_decline_all(True)  # or False if that's what you want

The changes are in the dev branch now. All you'd have to do is replace device.py with the device.py from the dev branch to test. I have been testing and it seems to work well, but would be happy to have another tester.

from wxcadm.

Related Issues (3)

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.